How do I cycle thru object animations by touching object during game

Two questions: How do I let players touch an object and change the objects animation and to only be able to do so at start of game.

Currently it will change animations but player has to touch something else then touch the object and repeat that each time they try to change animation. I only want them to have to touch the object and the object change animation. The object has 4 animations. The game has 16 of the same object, all the objects have the same 4 animations. I want player to decide which animation each object has and change animation by touching the object. (this forum would only let me post 1 pic otherwise I would have posted the other pic of the rest of the code). Ty

Ok, first off you can do this with one event.
The hardest part of this is that there’s 16 of the same sprite in the scene.
This means you have to use the “pick nearest object” condition at the top of the conditions in that event.
Then insert the Expression call for MouseX and MouseY into the X and Y slots to only change the animation of the sprite closest to the mouse.
The whole event to make this work is:

CONDITIONS
Pick the ___ that is nearest to CursorX();CursorY();
The cursor/touch is on ___
Trigger once

ACTIONS
Change the number of the animation of ___: add 1


If you want the player to have to click the mouse to change the animation you can add a:

Touch or left mouse button is down

Anywhere in the conditions
If you want the player to move a character onto the objects supposed to change animation to make them change animation

You can replace the

The cursor/touch is on ___

With a

___ is in collision with ___

Hopw this helps

Agreed. I would just add mod().mod() returns the remainder of the first # divided by the 2nd. So, if the 2nd is the number of animations then when it’s that number the remainder will be zero and it will go back to animation 0. When the 1st is less than the 2nd, it just returns the 1st number.

If you want to limit when it happens then add a check for a variable as the first condition. I like booleans. So, I would use something like boolean value of variable EditMode is true Then just set it to true or false. You can use any condition or variable type. Booleans are easier to understand.