Hello,
I have a FPS that I have been working on for the past few months. From a functionality standpoint, most of everything is implemented.
However, I did notice one thing recently - the AI certainly rotates to look at the player, but does not seem to account for the height of where the player is at. As a result, if the player is on an elevated position, the AI will never hit them.
I am using a Behavior Tree, where I set the AI’s default focus to LastKnownPlayerLocation. As follows.
I then use SetDefaultFocus on the blackboard value from this line, as shown below.
Below is my code for the actual shooting itself-
Why is it not accounting for the verticality of the player? It just fires straight ahead in the player’s direction, instead of rotating upwards/downwards. As shown in the below image with the debug line(the player is on the top of the boxes).