Sorry if this is painfully obvious, but I cant seem to figure this out for the life of me. I’m simply trying to rotate this sprite like a wheel. However the rotor body just falls off the screen, instead of staying on top of the sensor and rotating.
[lua]function newRotor(x,y)
local rotor = display.newImage(“sprites/rotor.png”,x,y)
local rect = display.newRect( x+45, y+45, 5, 5 )
rect.isVisible = false
physics.addBody( rect, “static”,{ isSensor = true } )
local rotor_body = physics.addBody(rotor, { density = 1.0, friction = 0.3, bounce = 0.2 , radius = 50})
local myJoint = physics.newJoint( “pivot”, rect, rotor_body, rect.x,rect.y )
myJoint.isMotorEnabled = true
myJoint.motorSpeed = 10.00
myJoint.motorTorque = 20.00
end[/lua] [import]uid: 9484 topic_id: 17813 reply_id: 317813[/import]