Reputation: 31
I'm using Farseer in Unity and I'm having difficulty figuring out how to remove joints using script. I want to remove all the joints in my scene. I've been trying to use things like: world.JointList and world.RemoveJoint but since in Unity the joints are components (ie FSPulleyJointComponent) I don't understand how to access the joint itself.
Any help would be much appreciated.
Upvotes: 1
Views: 271
Reputation: 31
My bad... world.JointList and world.RemoveJoint both work fine. I wasn't getting the world properly.
Upvotes: 0
Reputation: 39164
I've never used Farseer
, but if joints are implemented as Components
than they can be removed using Object.Destroy.
If Destroy
is used on a Component
's reference, then it will be removed from the GameObject
it's attached to.
Upvotes: 2