This project has moved. For the latest updates, please go here.

WeldJoint not active

Topics: Developer Forum, User Forum
Oct 27, 2013 at 1:41 PM
Hi everyone,

I have a problem with a WeldJoint which doesnt seems to work.
I don't understand why because it's not the first time I use it.

Here is my code :
        private void OnRTriggerPressed()
            R_triggerPressed = true;
            parent.rigidBody.Body.IgnoreGravity = true;
            //parent.rigidBody.Body.BodyType = FarseerPhysics.Dynamics.BodyType.Dynamic;

            if (grabJoint != null)
                grabJoint = null;

        private void OnRTriggerReleased()
            R_triggerPressed = false;
            parent.rigidBody.Body.IgnoreGravity = false;

            if (fixtureList.Count > 0)
                //parent.rigidBody.Body.BodyType = FarseerPhysics.Dynamics.BodyType.Static;
                grabJoint = JointFactory.CreateWeldJoint(RigidBody.Body, fixtureList[0].Body, Vector2.Zero);

The joint is supposed to be built with the first body encountered when I release the gamepad trigger, and destroyed when I press it.
The joint is correctly created and added to the world, but the body continues to act like there is no joint attached.

Any idea where this can come from ?


(I'm using FPE 3.3.1)