I can’t destroy joint. ;/
[code]playerRotation = function()
if(press)then
player.bodyType = ‘dinamic’
myJoint:removeSelf()
end
if(hit)then
player.bodyType = ‘kinetic’
myJoint = physics.newJoint( “pivot”, player, objektas, player.x, player.y )
end
end
Runtime:addEventListener( “enterFrame”, playerRotation )
local function onCollision( event )
hit = true
end
Runtime:addEventListener ( “collision”, onCollision )
function onTouch( event )
press = true
return true
end
background:addEventListener( “touch”, onTouch)
[import]uid: 123082 topic_id: 21566 reply_id: 321566[/import]
An object falls on a wheel and makes a joint to spin together and after a touch the joint should be destoyed, but it returns nil. I think i cant maintain the a reference to the joint. [import]uid: 123082 topic_id: 21566 reply_id: 85793[/import]