Page 1 of 1

How do I make npc stop running next to a wall

PostPosted: Tue Sep 02, 2014 12:56 pm
by Roal465
> So I create player sprite and enemy sprite. Both have platform behavior. Enemy fallow player when distance is smaller then 75 pix.
Problem start when enemy can't fallow you and is running into wall. Player animation change to iddle when is running into wall, enemy make error and dont change animation. Both use same events. How to fix that?

Re: How do I make npc stop running next to a wall

PostPosted: Tue Sep 02, 2014 1:36 pm
by GT88
Create a variable "distance" for the enemy, then for each enemy - put into it distance to player. It works for me :)

Re: How do I make npc stop running next to a wall

PostPosted: Tue Sep 02, 2014 2:03 pm
by Katala
@GT88 You don't need "for every enemy".

Re: How do I make npc stop running next to a wall

PostPosted: Tue Sep 02, 2014 2:18 pm
by Roal465
Ok, it work! Thanks for help both of you!