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? ._.
asked Aug 23 '17 at 08:45 AM in Blueprint Scripting
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.
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.
answered Aug 25 '17 at 08:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here