UE5 - Physics Constraints - GetConstraintForce is not updating although joint moves

Hi there,

Every tick I am trying to read the current Force that holds a joint together with GetConstraintForce.
The constraint is initialized but the GetConstraintForce always returns (0.0,0.0,0.0).

I explain:

Two rigid bodies are connected with a linear constraint with a linear motor enabled.
I try to keep these two bodies at a certain distanced and so I set the target position of the linear motor every tick with “SetLinearPositionTarget”. The Linear Motor moves to that position. Good.

But if I apply a slight external force to one of the rigid bodies, the distance between the the two rigid bodies will change a bit but the Linear Motor does not fully correct that.
I want to find out why that is so I would love to see which Forces the Linear Motor generates in order to correct the position.
If I access the constraint with: constraint->GetConstraintForce(Linear, Angular),
the values I get back are all zero.

Why is that?

Hope you can help me :slight_smile:

1 Like