Select Collision Instances?

Get help using Construct 2

Post » Sat Jul 20, 2013 2:45 pm

Hi,

I am trying to select both colliding instances of a single object.



The first question is: how do I check multiple instances of ONE object against each others collision?

And at least, how can I access both involved instances (IID / UID)?

Many thanks :)xeed2013-07-20 14:48:29
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Sat Aug 03, 2013 12:05 am

This example was made for another question, but it shows you how you can get a hold of the instances if they are of the same type.

.capx

You can also do this:

+Sprite1: On collision with Sprite1
   +System: Pick Sprite1 instance 0
      -> do something
   +System: Pick Sprite1 instance 1
      -> do something

But here you have to know how many instances collide, or you could use it if you just want to pick one of them.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Sat Aug 03, 2013 6:17 pm

Thanks for your suggestion.

[quote]+Sprite1: On collision with Sprite1
   +System: Pick Sprite1 instance 0
      -> do something
   +System: Pick Sprite1 instance 1
      -> do something
[/quote]

Thats how I made it first, but it won't work. I am testing if the correct instances are selected to let them stop movement, but only one of them stops.

I also dont understand how this should work, since I guess the IID / UID does not change when checking for the collision to the other. Maybe someone could explain me what exactly happens in this condition

"Sprite1: On collision with Sprite1"

Many thanks
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests