fully extend a prismatic joint aftre creation ...

hello,

i have build a basic pressable switch using two bodys and a prismatic joint.
it works wonderfully.
however after creation, the joint starts at the lowerTranslation and then starts to "uncompress" to the upperTranslation
is there any way to have the joint at its upperTranslation directly after the creation?

thanks a lot!
The only way to do this is to set the positions of the two bodies involved to where you want them to start.
ah, thanks!
oh, wait it does not work...
even if i create the connected bodys at the upper translation positions, the joint starts at the lower, dragging the bodies there, the "expanding"
If you are using the 'Initialize' function to help set up the joint, remember that it looks at where the bodies currently are, to set the joint anchors. Depending on exactly what you're doing, you might have to move the bodies after you do the Initialize. My recommendation would be to just set the anchor positions directly yourself. This might be useful: http://www.iforce2d.net/b2dtut/joints-prismatic
If that's not the problem, maybe you could post some code.
Thanks a lot. That explained everything and did the trick!

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