This PR fixes the FollowEnemy's Attacking behavior.
It's more of a rewrite of the logic of player detection and how the attack should function. The enemy has also received some arms, that make it clear when the enemy attacks and the player takes damage.
Also took this opportunity to bring the state switching in line with the PlayerState class => FollowingEnemyStates class.
How to test:
Place down a Enemy1.prefab in any scene with a NavMesh Surface, make sure to bake the navmesh surface as well.
Verify the enemy's PLayerObj reference is set.
Hit play.
The enemy should be Roaming all over the navmesh surface.
When player comes into field of vision, it will transition to the Following state.
Once the player is within the attackrange, it will transition to Attacking state.
It will try to face the player and attack it. When it attacks there is an animation to lift it's arms and the player will receive damage.
Verify it respects the set attack cooldown between attacks.
Purpose of this PR:
This PR fixes the FollowEnemy's Attacking behavior. It's more of a rewrite of the logic of player detection and how the attack should function. The enemy has also received some arms, that make it clear when the enemy attacks and the player takes damage. Also took this opportunity to bring the state switching in line with the PlayerState class => FollowingEnemyStates class.
How to test:
Place down a Enemy1.prefab in any scene with a NavMesh Surface, make sure to bake the navmesh surface as well. Verify the enemy's PLayerObj reference is set. Hit play.
The enemy should be Roaming all over the navmesh surface. When player comes into field of vision, it will transition to the Following state. Once the player is within the attackrange, it will transition to Attacking state. It will try to face the player and attack it. When it attacks there is an animation to lift it's arms and the player will receive damage.
Verify it respects the set attack cooldown between attacks.
links:
closes #78