Giving a clone a variable

i am trying to get the clone to have it’s “side” and “player” variables be changed according to the player’s ID and step in the for loop.

Does the variables player and side are LOCAL variables in hitbox f1 ?

You can use the [scratchblocks]inherit [ v]::variables[/scratchblocks] block to inherit variables from the parent.

Make sure that hitBox F1 has the variables already set as for that sprite only, and then they can be changed for only that sprite, and clones should get their own copy of the variable.

I tried this and it did as expected

I notice that inside your loop, your not changing the value of player - could that be your problem?

As others have asked, have you created sprite only local player and side variables in the hitbox F1 sprite?


first one, i don’t think so, player is meant to be a constant once set
second one, yes, they are local only

If you run my variation what results so you see?

it fails, the variables side variable does not exist on the player (i found a work around with asking the player for the side)

Glad you've got it working.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.