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
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Ball restart velocity and position
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 :)
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 :)
Hey, no worries :)
ball.isFixedRotation = true
will stop it from rotating.
Hi again peach, dont work :S the ball continues rotating
Uh, that was unexpected!
OK, could you try this please;
ball.angularVelocity = 0
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 :)
yeh it works great peach :) thank a lot
Not a problem at all, sorry it took two goes ;)
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed