I am using this code and have two objects attached. I am now trying to limit the rotation but keeping getting a nil value for setlimits.
Any ideas where I am obviously going wrong.
local myJoint = b2.createRevoluteJointDef(myMan.body, myArm.body, randX-50 , randY)
myJoint:setLimits(1,1)
myJoint:enableLimit(true)
--local myJoint = b2.createDistanceJointDef(myMan.body, myArm.body, randX, randY, randX-50, randY)
myworld:createJoint(myJoint)
Mike
Comments
After you create your joint definition table with createXXXJointDef function, you directly set the limits
Optionally, you can set the limits after creating the joint:
Mike
http://www.sharksoupstudios.com