A instance overlapping B instance of the same obj

Get help using Construct 2

Post » Mon Jul 23, 2012 6:01 pm

I want to make NPC sprites avoid hitting each other. so I decided use is overlapping at offset.   however, in the action, how can I pick the source instance and the target instance? so that I can make the source NPC avoids the target NPC.

thanks
B
8
S
2
G
3
Posts: 15
Reputation: 2,749

Post » Mon Jul 23, 2012 6:40 pm

I dunno if it works with overlapping but with collision it picks the colliding objects and 0 is the one checking and 1 is the one it hit. I think thats the order.

Like I said I have no idea if it works with overlapping
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Tue Jul 24, 2012 1:55 am

thanks for the answer. in on collision , how can I pick 0 from 1. for instance if I want to write

event: On collision with NPC.   action: (first npc instance)NPC.x = (second NPC instance)NPC.x -10


or

(first npc instance)NPC.x = (first npc instance)NPC.x - (second NPC instance)NPC.x

thanks
B
8
S
2
G
3
Posts: 15
Reputation: 2,749

Post » Tue Jul 24, 2012 2:08 am

Sorry about my last message, I found what you meant in the manual. I have to use NPC(0).X and NPC(1)

http://www.scirra.com/manual/78/expressions?utm_source=Expressions&utm_medium=SoftwareLink&utm_campaign=SoftwareHelpLink

I tested and it works with is overlapping with.
Thanks for the help!   
B
8
S
2
G
3
Posts: 15
Reputation: 2,749


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, Braus, zenox98 and 2 guests