What is the best way to remove a weld joint?

Sep 7, 2012 at 8:42 PM

I have no problem creating a weld joint using the factory but I am not sure how to remove the joint. The only method I have found that works at all is iterating over the simulator jointlist for the body object and then deleting that joint, but it doesn't see to work consistently. I also noticed that the sprite.bodyobject has a joint list, but I am not sure how to remove all joints from the sprite.

 

Any guidance is greatly appreciated! Thank you

Jesse,

Coordinator
Sep 7, 2012 at 8:50 PM

Are you using the RemoveJoint method?

    physicsCanvas.Simulator.RemoveJoint(joint);

That should work. Also note that there is a PhysicsUtilities.FindJoint() method - but it sounds like you figured out how to iterate and find the joint OK.

Sep 7, 2012 at 8:55 PM
AndyBeaulieu wrote:

Are you using the RemoveJoint method?

    physicsCanvas.Simulator.RemoveJoint(joint);

That should work. Also note that there is a PhysicsUtilities.FindJoint() method - but it sounds like you figured out how to iterate and find the joint OK.


How did I not see RemoveJoint!! That works perfect. You are a life saver Andy, thank you!