How do I get variable from collided instance

Get help using Construct 2

Post » Fri Jun 13, 2014 2:28 pm

Hi there,

I've been searching the forum for hours, but I can't find what I'm looking for. Maybe you can help me?

I want to set a variable from one instance to the same variable of the same instance it collides with. I can't figure out how to get the (variable) value from the last collided instance. Is there a way I could do something like: set VarName to Sprite(last collided).VarName ?

Thanks in advance!
B
2
Posts: 3
Reputation: 156

Post » Fri Jun 13, 2014 2:42 pm

This is easier with Families, but can be done with a bit more work without.

You need to pick the 'other' instance, store it's value, then pick the 'first' instance and set it's value to the temporary value.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Fri Jun 13, 2014 3:12 pm

Thanks for the quick reply, i'm going to give it a try :)
B
2
Posts: 3
Reputation: 156


Post » Mon Jun 16, 2014 9:00 am

Thanks Blackhornet, the capx made it perfectly how to do it and solve a multitude of problems!

Lordshiva1948: Gonna look some more in the tutorial and get some better understanding :) Thanks!
B
2
Posts: 3
Reputation: 156


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 49 guests