How does a PhysicsConstraintActor work in limiting the rotations

I am trying to create an actor that cannot be rotated.

Instead of directly coding it into the engine, I want to make it already coded.

For now i am thinking of just resting the rotation each tick function. Or is there a better way to do it?