Download

Set sprite with a string

I have a game with 10 sprited. Sprite names are: sprite 1, sprite2, sprite3, etc

[When 1 click one of the sprites i want to the the sprite to a random sprite.

I tried generating a number from 1 to 10. For example 2 is generated and then turn this in to a string “sprite2” and then set sprite. I can’t connect the string and the setsprite.

How vcan i do this?

https://snipboard.io/RTfJyp.jpg](https://snipboard.io/RTfJyp.jpg)

Make an array of all your sprites (use Make Array or else set the defaults in the details panel of the variable).

You don’t need a string, you can use the integer to Get the array item of index (i.e. integer).
When you make the array variable, drag off a wire from it and type “get” to use the array getter which needs a index (integer).