[RESOLVED] Pick all counter

Hello,
I have a problem: I want to modify all instance of a sprite and change the animation.
Using this code:

the animation changes but the counter ‘ScObjectNumber’ remains set to 1.

I tried also with this code

but I obtain the same result.

Thanks,
J

I don’t know if it will work but you can try with:

Reapeat for each SpObjects
No condition

Action Pick all SpObjects for first and after the actions for change the animation and so on.

Yes, it works !!!

I don’t understand the diference between “Pick all” and “Repeat for each instance” but it works.

Thanks,
J

1 Like

There’s no difference between any of your approaches when it comes to changing the animation. The difference is the variable. The variable action is only going to be triggered once except when you put it inside the for each object The variable action will be triggered once per instance. The only difference with the animation action is whether all objects are set with one action or they’re set one at a time.

If you want to get the number of objects then you can use the SceneInstanceCount() and either set the variable to the value or add the value depending on what you’re doing.
image

1 Like