How do I make npc stop running next to a wall

Get help using Construct 2

Post » Tue Sep 02, 2014 12:56 pm

> 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?
You do not have the required permissions to view the files attached to this post.
B
9
S
3
G
3
Posts: 36
Reputation: 2,433

Post » Tue Sep 02, 2014 1:36 pm

Create a variable "distance" for the enemy, then for each enemy - put into it distance to player. It works for me :)
You do not have the required permissions to view the files attached to this post.
B
21
S
4
Posts: 29
Reputation: 1,253

Post » Tue Sep 02, 2014 2:03 pm

@GT88 You don't need "for every enemy".
You do not have the required permissions to view the files attached to this post.
B
34
S
9
G
3
Posts: 517
Reputation: 5,226

Post » Tue Sep 02, 2014 2:18 pm

Ok, it work! Thanks for help both of you!
B
9
S
3
G
3
Posts: 36
Reputation: 2,433


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, SignalOne and 17 guests