How to set line of sight (LoS) from scratch?

I’m new to Unreal 4 and I need some help.

I’ve set up a turret in the Third Person level and have set it to attack the player at a certain range. The issue now is that the turret will attack the player through walls as soon as they are within range of the turret.

How can I set up a line of sight for the turret so that it will not attack the player until they make themselves seen by the turret? I’ve been scouring the forums and YouTube for something that will fit the bill but I can’t seem to find instructions for setting up line of sight from scratch. I’m also rather new to Unreal so if someone could break it down simply it would be very helpful.

I used the following tutorials to make the turret so far:

I’ll post the turret blueprints I have now to see if that helps.

Thanks in advance!


You can use Trace Line for detect visibility of target. If the Turret cannot see actor, it doesn’t rotate and fire.

Awesome! I set this up and it works great! Thanks for the help.