How to stop HingeConstraint from Swinging too much?

I have a yellow part here and a HingeConstraint connecting the yellow part. The yellow part is moving by CFrame and it is anchored.

Is it possible to make the grey part not to swing that much?

I only want the grey part to swing in circumstances such as sudden acceleration / brake, I have tried massless, CustomPhysicalProperties and the behavior are more or less the same. I have considered using Spring / Other Constraints but I do not exactly know how to implement it. Any ideas?

Here’s a repro file (Press F8 to run)
HingeReplicationBug_Repro.rbxl (35.0 KB)

1 Like

You can make the HingeConstraint.ActuatorType to Servo, set the CurrentAngle to whatever it’s at, and just play with the HingeConstraint.ServoMaxTorque to control how much force is applied to dampen the swinging.
HingeConstraint.AngularResponsiveness can also be changed to vary how quickly the Servo tries to react to the swinging.

If you wanted to add a spring type Constraint you could use a TorsionSpringConstraint.

2 Likes

Why would the Grey part not move, if it is relative to the yellow part connection?

Have you done a weld constraint, of a large part to the grey part , that has a lot of custom mass, non collide on that part, to counter act the movement of the yellow, unless it is a huge movement?

I tried using Servo and it did not work as I have expected as well. If you have the time do you mind downloading the repro and do me a quick prototype with servo / constraints as well?

1 Like

What did you change the ServoMaxTorque, AngularResponsiveness, and AngulaSpeed settings to?
Try messing with the Density of the swinging carriage as well.

Do you have the DesiredAngle set to the CurrentAngle, or make sure both Attachments are aligned the same?

My only problem right now is the cabin stopping all the sudden, which value should I tweak to stop this? It seems that it will stop swinging and return to idle when it reaches around 20 degrees, no matter how much it swings beforehand.

Everything inside the cabin is massless.
image

2 Likes

AngularSpeed is in radians/second. I don’t think I’ve ever used anything that high!
I’d also lower the HingeConstraint.AngularResponsiveness. Higher numbers there will give you faster response times.
The MaxTorque value looks low enough, but it depends on how much Mass you are dealing with. If it has more inertia (more dense) then it’s going to swing back and forth more. An object set to Massless would have no inertia and would stop almost instantly if not instantly.

Just play with the values I mentioned.
I use Constraints for my suspension vehicles and it can take a lot of tweaking to get them just right.

Hi,
When I am trying your repo file, I re did the attachments to the HingeContrain, changed it to servo , and modified the servo settings, but the grey block just sits there in Play.

Any ideas why?

Thanks

Thanks, I will try tweaking these values.

1 Like

Press F8 to run instead of play. Related to the replication bug here: Hinge Constraint not replicating to client

1 Like