Hi, i am having some troubles with ball physics.
When i touch on a button or object my ball is dynamic and the physics are true and physics.setGravity( 0,7 ), and when i touch again on this button or on the object i need to stop the ball at x= 100 and y =200 but i dont want to stop the physics, i change the physics gravity to physics.setGravity( 0,0 ) and
myball.x=100
myball.y= 200
but the ball never stop, she can go to this position and accept my physics gravity, but the movement of the ball dont stop, without stopping physics how i can stop the ball on the position that i need? i need to restart the initial position of my ball [import]uid: 26056 topic_id: 21291 reply_id: 321291[/import]
Try setting the ball’s linearVelocity to (0,0) when you change the gravity to (0,0) and see if that sorts it out. Let me know.
Peach
[import]uid: 52491 topic_id: 21291 reply_id: 84377[/import]
hi peach thanks for the help, it works, setLinearVelocity (0,0) and stop the movement of the ball but the effect of rotation dont stop, how i can stop the rotation of the ball?
Thanks
[import]uid: 26056 topic_id: 21291 reply_id: 84423[/import]
Hey, no worries 
[lua]ball.isFixedRotation = true[/lua] will stop it from rotating. [import]uid: 52491 topic_id: 21291 reply_id: 84486[/import]
Hi again peach, dont work :S the ball continues rotating [import]uid: 26056 topic_id: 21291 reply_id: 84495[/import]
Uh, that was unexpected!
OK, could you try this please;
[lua]ball.angularVelocity = 0[/lua]
If that doesn’t work let me know and I’ll delve deeper - it has been a little since I’ve played with this sort of thing but I believe that should fix it.
Peach
[import]uid: 52491 topic_id: 21291 reply_id: 84593[/import]
yeh it works great peach
thank a lot [import]uid: 26056 topic_id: 21291 reply_id: 84610[/import]
Not a problem at all, sorry it took two goes
[import]uid: 52491 topic_id: 21291 reply_id: 84613[/import]