Why doesn't my ball spins?

I made this code: 

    

ballImage = "ballImage.png"     circle = display.newImage( ballImage, {x=\_W/2, y=\_H\*0.885})      circle.width = \_W\*0.06     circle.height = \_W\*0.06     circle.type = "circle"     physics.addBody( circle ,{radius=\_W\*0.030} )

When he collides or falls it is’nt spinning but always remains straight . (But he moves and reacts to clashes)

Why is that and how can i fix it?

        transition.to( circle[i], { rotation = circle[i].rotation+720, time=15000, onComplete=spinImage } )

Try putting that in there. If that does not work, Then do this:

    local PUTYOURNAMEHERE = {}     local i = 1     local PUTYOURNAMEHERETimer

Then do:

 local spawnCircles = function()          local Fall = math.random(display.contentWidth \* -0.2, display.contentWidth \* 1.2)          PUTYOURNAMEHERE[i] = display.newImageRect( "YOURIMAGENAME.png", 20, 20)          sceneGroup:insert(YOURNAMEHERE[i])          physics.addBody( YOURNAMEHERE[i], "dynamic", { isSensor = false } )      end 

But if that does not work, remove the “sceneGroup:insert(YOURNAMEHERE[i])”

and try it.

[quote=“Spid3rtech,post:2,topic:335173”]

 transition.to( circle[i], { rotation = circle[i].rotation+720, time=15000, onComplete=spinImage } )

Try putting that in there. If that does not work, Then do this:

 local PUTYOURNAMEHERE = {} local i = 1 local PUTYOURNAMEHERETimer

Then do:

 local spawnCircles = function() local Fall = math.random(display.contentWidth \* -0.2, display.contentWidth \* 1.2) PUTYOURNAMEHERE[i] = display.newImageRect( "YOURIMAGENAME.png", 20, 20) sceneGroup:insert(YOURNAMEHERE[i]) physics.addBody( YOURNAMEHERE[i], "dynamic", { isSensor = false } ) end

But if that does not work, remove the “sceneGroup:insert(YOURNAMEHERE[i])”
and try it. [/quote]
This isn’t the correct approach.

@original poster, do you have

circle.isFixedRotation = true 

set anywhere perhaps?

Do you change the circles body type anywhere?

you’ll need non-zero friction during contact to impart spin on your circle

Did you solve this or still need help?

        transition.to( circle[i], { rotation = circle[i].rotation+720, time=15000, onComplete=spinImage } )

Try putting that in there. If that does not work, Then do this:

    local PUTYOURNAMEHERE = {}     local i = 1     local PUTYOURNAMEHERETimer

Then do:

 local spawnCircles = function()          local Fall = math.random(display.contentWidth \* -0.2, display.contentWidth \* 1.2)          PUTYOURNAMEHERE[i] = display.newImageRect( "YOURIMAGENAME.png", 20, 20)          sceneGroup:insert(YOURNAMEHERE[i])          physics.addBody( YOURNAMEHERE[i], "dynamic", { isSensor = false } )      end 

But if that does not work, remove the “sceneGroup:insert(YOURNAMEHERE[i])”

and try it.

[quote=“Spid3rtech,post:6,topic:335173”]

 transition.to( circle[i], { rotation = circle[i].rotation+720, time=15000, onComplete=spinImage } )

Try putting that in there. If that does not work, Then do this:

 local PUTYOURNAMEHERE = {} local i = 1 local PUTYOURNAMEHERETimer

Then do:

 local spawnCircles = function() local Fall = math.random(display.contentWidth \* -0.2, display.contentWidth \* 1.2) PUTYOURNAMEHERE[i] = display.newImageRect( "YOURIMAGENAME.png", 20, 20) sceneGroup:insert(YOURNAMEHERE[i]) physics.addBody( YOURNAMEHERE[i], "dynamic", { isSensor = false } ) end

But if that does not work, remove the “sceneGroup:insert(YOURNAMEHERE[i])”
and try it. [/quote]
This isn’t the correct approach.

@original poster, do you have

circle.isFixedRotation = true 

set anywhere perhaps?

Do you change the circles body type anywhere?

you’ll need non-zero friction during contact to impart spin on your circle

Did you solve this or still need help?