How can I ues EQS to make my enemy still in the player's field of view?

At first I was using players directly. Generate points that can be queried with this actor as the center. However, I found that the enemy’s wandering position is always directly in front of the player’s character. If the player shifts the perspective slightly, the enemy cannot be seen. This is what I want to improve. Let the center of the enemy’s wandering be the position annotated by the player’s camera.

Hello @7bfec5627f5648c4bcfe4cd0fd9f9f23

You can use the Dot filter in your EQS point generator to calculate the dot product of the direction from the player point of view to each scored point and the point of view direction vector, with the points being generated around the player’s point of view. If the dot product result is < 0 it means the point is behind the point of view, if the dot product result is equal to 0 it means the point is directly to the left or to the right (180º) of the point of view. Result > 0 means the point is in front (1 being directly in front of the point of view). You would need to filter the dot result to match your FOV.

Here you have some math reference with visual representations: Interactive Dot Product of Two Vectors

1 Like

Ok I will try. Thank you!