Unpause - problem with actor
kelseabarker
Member, PRO Posts: 15
Hey everyone! I'm newer to GS and I just had a question that I hope I can explain well haha. In my game, I have an actor set to drag when you move your finger on it, basically just a touch and drag. Well, when I unpause that scene from the pause menu, my actor moves to where the unpause button was. So say you dragged the actor towards the bottom right of the screen before you paused the game, and since the unpause button is on the middle of the screen, when you hit unpause, the actor goes straight to the middle of the screen instead of staying in the bottom right corner. Is there any way to fix this? Thank you!
Answers
You can try creating game level Booleans > if game.paused = true -- game.yourdragbehaviour = false.
Create a second rule(you can also you othewise in the first one) > if game.paused = false -- Timer(after 0.2 seconds -- game.yourdragbehaviour = true) I haven't tested it but I think this might prevent your drag actor from moving to another place suddenly after unpausing.
Hope this helps.
@Shahrukh_1810 Thank you very much for the answer! I tried this out but am still having trouble with it I tried the timer but it did something funky.. I'm not sure what I'm doing wrong..
@jamie_c Ah thank you so much! Your code worked perfectly. Thanks for all the help!
You're welcome.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page