x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How can I hide everything behind line of site in a top down game

I'm creating a top down isometric game for my first attempt, it's a recreation of a childhood game I played for hours as a kid.

I'm just unsure how I can hide everything that is blocked by line of site, here's an example

Where my character is standing, I shouldn't be able to see behind that wall to the characters right, I'm just unsure how I can accomplish this. Thanks.

c

Product Version: UE 4.20
Tags:
capture.png (3.0 MB)
more ▼

asked Nov 06 '18 at 07:11 AM in C++ Programming

avatar image

Gacnt
6 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

The most straightforward way I can imagine is doing raycast checks for player visibility continuously, then having an opacity parameter in the object's material, which you then feed the result of the visibility check, basically.

This requires work on every object that should be able to become transparent though. I'm not sure an easier solution exists though.

more ▼

answered Nov 06 '18 at 10:04 AM

avatar image

Quexlaw
79 6 11 17

avatar image Gacnt Nov 06 '18 at 10:32 AM

Thanks for the reply. The only thing I can’t figure it is how I can hide the landscape too. I wish there was something painfully simple like being able to shape and size a UMG widget to cover the screen space that isn’t visible in just black or something.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

there are many ways to implement this.

In case you want to hide mesh completely - make multiline or multisphere trace from camera to character, and set visible = false for everything this trace returns. Then store it in some array and make visible when it is not overlapped anymore. Remember that everything you want to hide must have collision response for trace channel set to "overlap" to make multi-trace work correctly.

Additionally you need to use at least cascaded shadow maps to make shadow of hidden object disappear also, if you nedd this. Or mke it cast HiddenShadow if you use CSM but want shadows.

Here is an example:

alt text

alt text

more ▼

answered Nov 06 '18 at 11:55 AM

avatar image

redbox
4.3k 80 17 104

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question