SillyBusinessInc / SillyBusinessGame

A game created by Silly Business
0 stars 0 forks source link

Fix/#78 fix enemy attack #90

Closed PimMiii closed 2 days ago

PimMiii commented 4 days ago

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

PimMiii commented 2 days ago

lord forgive me for i have sinned. I only noticed now that i have edited the enemy prefab in production 😅

WantToBeeMe commented 2 days ago

@PimMiii Didnt you give the enemy arms just now? image