HingeConstraint isn't working correctly

Hi,

I tried adding a hinge constraint to a door but the hinge constraint doesnt seem to be working correctly.

As you can see the target angle is set to 90, so when I play the game it should make the door turn. But that doesn’t happen unless I rotate the door.

How do I fix this?

Here’s another video where I change the targetangle. It doesn’t work only until I rotate it.

https://gyazo.com/2182a695d914912e51edededb70d9276

Make sure the yellow and orange arrows on your Attachments are pointing in the same direction. The yellow arrow is where the HingeConstraint pivots around.

Your ServoMaxTorque is 999. That is a very tiny force. Try having it around 100000.

Make sure your door is just a tiny bit smaller than the frame so the door doesn’ t contact the frame. Look at real life doors and you’ll see what I mean. If you make them the exact same size they will interfere with each other.

A great tool when using Constraints is in your File > Studio Settings > Physics menu. Click on the AreContactPointsShown tool. It will show red spheres wherever 2 Parts touch which helps you troubleshoot items like this.

1 Like

999 always works for me, but for this particular model, it is too little which is a little weird for me. I made it bigger and it worked smoothly and exactly how I wanted it to be… Thank you I didn’t know this!

With a value like 999 I’m guessing that if a player was in the way it wouldn’t move them at all. The MaxForce is the torque force for rotating the hinge. The AngularVelocity is the speed it rotates.

Hinges aren’t very strong. If you get into making Vehicles you can see this.
Also your AngularResponsiveness plays a factor as well. It’s basically the ‘how much does the Servo try to get to its TargetAngle’ Property.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.