Hey guys,
I’m making puzzle game and I have problem with transition.to.
It works fine, I mean it does what it should do but not really. It moves player to start position
every time user press restart button but after few retries(pressing restart button) player press GO button and physics start and they are applied to player pretty strange, like I applied force to player which I don’t.
It acts like sprite which was on starting position pushes down existing sprite when it moves to start position.
Here’s my code for restart button.
Hope anyone can help.
local btnrepPress = function( event ) transition.to(billy, {x = 200 , y = 100, time=0, rotation = 0}) physics.pause() rotate:addEventListener("touch", rotateObj) circle:addEventListener("touch", onTouch) circle:addEventListener("touch") end
EDIT : I actually found the problem. It’s not problem with transition.to or anything like that.The problem is that physics are just paused with rep button which means they will continue doing what they wanted when I start them again so if object was falling and I pause physics and change x and y of object when I start physics again object will sort of double fall. Is there any way to reset physics? I’ve tried physics.stop() but once u call it there is no way to start physics again at least I couldn’t manage to do so.