Motor turning in the wrong direction

How do I fix the motor making the gate turn the wrong way?

Current Result:

Expected Result:
image

I have tried rotating the pivot part and the result is still the same.

This happens to me often when making rotating parts, it usually gets fixed when I rotate the pivot part repeatedly and keep running studio.

You could also try changing the gate’s pivot orientation, so it won’t be visible but will still work?

Rotate the attachments.
The 2nd attachment of the HingeConstraint will automatically match it’s orientation and position of the 1st attachment.