Slider control only move one way

I’m trying to use a SliderJoint to act as the ‘lifter’ on a forklift.

joint = new SliderJoint(vehicle, lifterControl, Vector3f.UNIT_Y.negate(), Vector3f.UNIT_Y, true); (vehicle is a VehicleControl, and lifterControl a RigidBodyControl)

No matter what I put for those vectors, I can only ever get the vector to move along the Z axis, is this the only way It can move or am I doing it wrong?

(I also tried a SixDofJoint but cannot make the joint move, and also tried using a Kinematic RigidBodyControl, but cannot get this to follow my VehicleControl)

Yes, that’s actually how the slider joint works (Z-axis). There are some references somewhere on the internet but I can’t find them right now.
The vectors you put in the constructors aren’t directions, they are positions on the bodies where the joint should be attached.

To make a forklift you have to rotate the joint so the local Z aligns with the world Y.

1 Like

Ahhh rght I see what that constructor is for, thanks

edit: Does it actually matter where I place them? Seems to be making no odds for me at the moment

Is there a way I can lock the joint in place for a time? The rigidbodycontrol I’m using it to hold and move is constantly falling, and while I can hold it when applying a force, if I then want to hold an object with it I have to constantly change the force