Change scene on button press and have it change back by itself?
Lokitoes
Member, PRO Posts: 187
Hi all,
I am having a problem with something that seems simple, Basically I want to change scene when a button is pressed, but have that scene revert back to the original scene by itself after a certain amount of time (say, just 10 seconds). Using a ‘for’ timer on keyboard press rule doesn’t seem to work – it will change but it won’t change back. Clearly I need to do something more intricate to get this to work…?
I’ve also tried doing it more simply with an image rather than a scene, but the response is the same. Clearly the ‘change’ behaviours are the wrong ones to use for this…?
I imagine I need to play with attributes instead but I don’t know where to start?
Any help is appreciated. ☺
Cheers
Comments
In your button have a rule that says: When touch is pressed - change scene to "your scene"
In that new scene put an actor that have a rule in it that says: When self.time = 10 seconds change scene to "the scene you were before"
Damn that was easy. Thanks @Dues I'm an idiot!
Does the same go for changing between actors? Not sure how one even changes an actor rather than an image of that actor...
No problem
Hiw would you like to change the image?
@Dues Image is probably the wrong term... I'd like an actor to change to another actor on a button press rule. (Then in turn that actor could change to another or back to the original, etc).
You could destroy actor, spawn new actor at same location.