Greetings, I am doing my UE4 game and I faced some difficulties. In my concept all Enemies can move ONLY when I see them. So if I turn away, they stop. Any ideas how to make it possible?
The correct way to do this is to get the view frustum of the player camera and test for collision against all actors in the game world. This accounts for changes in screen size, FOV, and view distances.
Behind the scenes, what you’re essentially going to be doing is grabbing an actor in world space coordinates and converting it into screen space coordinates by taking the view and projection matrices and calculating the inverse matrix and applying it to the world space coordinates (vague hand waving, I know. This is a google search away).