How do I Compare Distance for Enemy AI

Get help using Construct 2

Post » Mon Sep 07, 2015 7:15 am

Hey there,
I am currently using the Line-of-sight behavior on my Enemies to move to my player. Unfortunately, they move to him and right on top of him. I tried giving my Player the solid behaviour but that just disabled the LoSight for some reason. Overlapping Player won't work because that event wont be true until the entire enemy sprite is overlapping the Player.

I can't seem to figure out any events to handle this. I don't want to create an invisible sprite around my Player, just to handle these events. That just seems amateurish.

Does anyone know how to stop the movement and reenable it when/if the player starts to move?
B
56
S
15
G
13
Posts: 826
Reputation: 17,645

Post » Mon Sep 07, 2015 8:07 am

I made a little example. Is it that what you're looking for?
drive.google.com/file/d/0B5FlDY8sggF4d0xHX2Z6eWRBYms/view?usp=sharing
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Mon Sep 07, 2015 8:09 am

Wow, that is exactly what I needed. Thank you!
B
56
S
15
G
13
Posts: 826
Reputation: 17,645


Return to How do I....?

Who is online

Users browsing this forum: tarek2, Yahoo [Bot] and 22 guests