Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | o k |
I’m making a top down shooter where enemies have a field of vision. If the player enters the FOV of the enemy, the enemy runs to the player. I’m having trouble with making the FOV work properly. The way my FOV system is supposed to work is the enemy uses the dot product to figure out if the player is in front of the enemy. If yes, then the enemy shoots a ray towards the player to check if there isn’t anything blocking the view to the player. My problem is I can’t figure out how to get the facing direction of the enemy that is supposed to be used to figure if the player is in front of the enemy in the dot product. I have tried a lot of things and nothing works so far.