How to stop ball from spinning

I have this basic code entered (with physics engine on, etc.) –

–Add a ball
local ball = display.newImage(“coconut.png”)
ball.x = 155
ball.y = 200
ball.xScale = 2.3
ball.yScale = 2.3
ball:setReferencePoint( display.CenterReferencePoint )
physics.addBody( ball, {friction=0.5, bounce=0.5, radius=45} )

–Add Event Listener and allow for interactivity
function moveBall(event)
local vx = (ball.x-event.x)/100
local vy=-5.0
ball:applyLinearImpulse( vx, vy, event.x, event.y )
end

ball:addEventListener(“touch”, moveBall)

The ball reacts how I would like, but it spins at an increasingly fast rate and it looks very unprofessional. How do I fix this? [import]uid: 39628 topic_id: 7557 reply_id: 307557[/import]

Fiddle with the angularDamping and/or angularVelocity property:

http://developer.anscamobile.com/reference/index/bodyangulardamping
http://developer.anscamobile.com/reference/index/bodyangularvelocity [import]uid: 41305 topic_id: 7557 reply_id: 26847[/import]

I’ve tried both the above with no success, or, I should say, not the success I need.

I set bodyAngularVelocity to zero as often as I can, using an enterFrame event handler, but the ball still manages to change its attitude and become off center. I also set bodyAngularDamping to a fairly large number. I’m honestly not sure what it does, but I did anyway. :slight_smile:

So, is it possible to completely keep the ball from ever spinning at all?

Thanks,

Sean. [import]uid: 4993 topic_id: 7557 reply_id: 29038[/import]