How do I check the other object variable

Get help using Construct 2

Post » Mon Jan 04, 2016 10:46 pm

Hello!

I wonder.. is there anyway to check / see the other objects in collision variables?

For instance.. suppose I have a car driving around... when it collides with another object I would like to check the other object's variables. Depending on the other object variables involved in the collision my car would change its state...

Thanks!
Rick
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Mon Jan 04, 2016 10:49 pm

On collision, both objects are picked, so just check what you want.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Mon Jan 04, 2016 11:13 pm

Thanks blackhornet... but.. what if one object is just colliding with another of its instance? Is it possible to know which variable am I checking? From which instance? =)

For example... I am spawning 2 objects and they will collide.
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Mon Jan 04, 2016 11:28 pm

Make a Family of the same (or all) objects, then check against colliding with the Family. You now always have two unique objects to work with.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Tue Jan 05, 2016 1:11 am

blackhornet wrote:Make a Family of the same (or all) objects, then check against colliding with the Family. You now always have two unique objects to work with.


Or you could use "system pick nth instance", but the family solution is much easier..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests