Line Of Sight On/Off


I have a script that changes a material of an actor in a blueprint when it is in the line of sight of the player, but Once it has been triggered to it stays that way. I can’t figure out how to toggle it so that when it is NOT in the line of sight, it reverts to it’s original color.

My blueprints are set up such that the Player blueprint handles to detection and that tells the actor blue print to switch on.

Also, note that I use Event Tick to initiate the checking of the LoS, and I’m sure there is a less costly way to do it. Suggestions welcome.

Actor BP.jpg


Hehe, just execute a ‘Not Looking At’ if the branch is false :stuck_out_tongue:

Edit: Line traces are hardly costly, I can do hundreds of them per frame and have pretty much no FPS impact.