How do I call a function inside a loop, passing each sprite?

Get help using Construct 2

Post » Tue Oct 20, 2015 7:02 pm

Hello All (again) :)

I have a "For" loop, and inside it I want to call a function that will run on the instance being select by the "For" loop.
Calling the function as of now runs the actions on ALL sprites, and not just the specific instance...

Any workaround to this?

Thanks! :)
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Post » Tue Oct 20, 2015 7:07 pm

Create an instance variable and add that as condition.
or
Use the sprites UID


Nice to also use function.parms to pass on the information once you get the sprite.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Tue Oct 20, 2015 7:18 pm

DUTOIT, I ended up passing the Sprite.UID as a parameter and use System->Pick by evaluation to find the correct instance.

Thanks a lot!!!
B
17
S
7
G
1
Posts: 157
Reputation: 1,878


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests