I want to create a block which only moves up and only when hit from below. I am trying out a distance joint and I read it can be used as a spring, is this the correct solution?
the way I have tried it is to create a block, and right underneath it I created a body and created a distance joint between these 2, however I do not see any type of spring physics, the block just falls down and acts like a rope joint.
DistanceJointDef j = new DistanceJointDef();
j.type = JointType.DistanceJoint;
j.frequencyHz = 4f;
j.dampingRatio = .5f;
j.bodyA = body;
j.bodyB = body2;
my joint def.
edit: right now I am just using a pristmastic joint and so far it seems okay.