- Home /
Changing state on touch, then looping back to beginning,Returning to initial state after game objects changed (or possibly pulled from array)
Hi guys,
I have a beginner question here. I'm trying to make a little scene that has within it a few different 'picture frames'. Within each picture frame is an interactive, animated picture. The user can press on each picture, causing that game object to change to a different picture. If they press again, it goes to indeed a third picture. And if they press a fourth time, it goes back to the original picture in order to be cycled through all over again. So it's not necessarily just as simple as destroying each object along the way.
So it's like I need each picture to be attached to a number or class, allowing it to cycle through on button press. And there will be several of these on the screen that need to work independently, so each would have their own script.
I'm a beginner to c# scripting, can anyone help me to get started with this? I've heard this would be easier to do by cycling through sprite states, but these will be animated game objects (2D), not just still images, so I need to also allow for animation within each one.
I'm also trying to keep myself open to the idea that the user may not press it by themselves, so I may need to make this in such a way that I could potentially add a timer script in later for it to cycle between certain states automatically. Though I'm not sure if that makes a difference to how I do this, at this stage.
Thanks for any help anyone can give me.
Your answer
Follow this Question
Related Questions
Changing picture 1 Answer
Programmatically created AnimationClip will not loop 2 Answers
Checking an array variable in C# vs JavaScript 3 Answers
Help with array with animators. 1 Answer
Animation glitch when looping. 1 Answer