PrismaticJoint changes its direction?

Hi, I got strange results when I create PismaticJoint and then load a force to it (for example by throwing down box onto it).
When the force is loaded, prismatic joint strangely changes its direction. I initialized it to [0,1].
Code:
jpd.Initialize(m_world.GetGroundBody(), objectBody, objectBody.GetWorldCenter(), new b2Vec2(0, 1));
jpd.upperTranslation = 2;
jpd.lowerTranslation = -2;
jpd.enableLimit = true;
jpd.motorSpeed = 0;
jpd.maxMotorForce = 100;
jpd.enableMotor = true;
jp = m_world.CreateJoint(jpd) as b2PrismaticJoint;


What's wrong?
What do you mean it changes direction? The axis changes? You set it to 0,1 and then when you touch it it changes to... what?
If you want the axis to stay along 0,1 then one of the bodies the joint is attached to should be a static body.
irresistible force wrote:
What do you mean it changes direction? The axis changes? You set it to 0,1 and then when you touch it it changes to... what?
If you want the axis to stay along 0,1 then one of the bodies the joint is attached to should be a static body.


Yes the axis changes accordingly to angle of force.
I want the axis to stay along 0,1. Isn't ground body static?
adq wrote:
Isn't ground body static?
It should be... but if you are seeing this behavior then something is not right. What do you declare the variable jpd as?
as b2PrismaticJointDef

Original thread: https://box2d.org/forum/viewtopic.php?t=5730