Junior Tech Game Designer
Junior Tech Game Designer
When the player character enters into enemy’s field of view, patrol behavior is stopped and « SeePlayer » behavior is started : Each frame enemy is rotated in the direction of the player. The distance with player is checked and while it is greater than 0, a forward velocity is added to reach the player. When the player is reached, a timer is started and when it expires an animation is played, if the player character enters in enemy collider, health points are removed. Damages taken, can be set in the editor).
The only difference with melee enemy is Distance enemy doesn’t move, a delay can be set in the editor and each time this delay is reached, a projectile is instantiated.
Each frame a forward velocity is added to the projectile, if the projectile enters in player collider, health points are removed (damages taken can be set in the editor).
Stun is compatible with melee and distance enemies. A trigger is placed over the enemy. Another trigger is placed at the below the player. When player is in the air if player is falling and the two triggers collide, enemy behavior is stopped for a while and once delay is reached « SeePlayer » state is reactivated.
(+33)7.68.26.54.84.
tristanbonnetpro@gmail.com