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"

Check if an Object IS VISIBLE in Camera / FOV / Field of View

How can i check if an Object / Character / Actor "IS VISIBLE" for the Player or not? (Is in FOV 90° and nothing blocking the View) I want to make an AI that randomly spawns around when the Player CAN'T SEE it, and do something else if he CAN SEE it.

I just found some Blueprint explenations online, like line trace but I couldnt find anything on how to use it in game.. I'm still pretty new...

Any Idea on how I can do this? ._.

Product Version: UE 4.16
more ▼

asked Aug 23 '17 at 08:45 AM in Blueprint Scripting

avatar image

5 1 2 4

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

2 answers: sort voted first

A ghetto but maybe effective way is to just attach a collision box [sized to how far you can see] in front of your playable character. Then use the overlap/is in field blueprint nodes for an even to happen when the AI comes in contact with it. Then create an event when the AI is no longer in the collision box.

more ▼

answered Aug 24 '17 at 07:14 AM

avatar image

3 1 2 3

avatar image XynoTV Aug 24 '17 at 11:58 AM

i tried that before and yeah it actually worked. But it was just WAY to ghetto :D Because then my AI triggered the ItemPickup by EventOverlap. So I could pick up Items that are 20m away, because of the AI standing near to it :D

So sadly, I cant do that ._. But still, thank you :) I appreciate your reply ^-^ <3

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

Itll miss a little on the edges but do a cone trace from the players eyes in the direction they are looking. The returned list is actors that the player is looking at. To simplify it, I'd use a custom collision channel so that only certain types of objects are returned.

more ▼

answered Aug 25 '17 at 08:40 PM

avatar image

296 6 7 10

(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