HingeConstraint causing shaking when equipping a tool

I’m making a compass tool that uses a HingeConstraint to rotate the compass’ needle, and unfortunately whenever I equip the tool my character shakes/wobbles for a short duration. This only happens when the needle is connected to the compass using a HingeConstraint, as trying:

  • Welds
  • WeldConstraints
  • RodConstraints
  • RigidConstraints

result in the character correctly equipping the compass without shaking

This is a screenshot showcasing the current configuration of the HingeConstraint:

I have tried:

  • Increasing and decreasing the AngularResponsiveness
  • Increasing and decreasing the AngularSpeed
  • Setting the ServoMaxTorque to large values like 100,000 & 10,000 and small values like 1000 & 10 instead of infinity

but unfortunately the issue still persisted, which is why I suspect that it could be a bug and thus made this report

Here is a video I recorded showcasing the problem I’m experiencing in its first half (The second half showcases a separate issue I previously had with the compass, but now that issue is thankfully solved with the help I received here in the DevForum):

I will also provide a place file with my compass tool here:

CurrentlyBrokenCompass.rbxl (44.2 KB)

Studio and system version information
  • Roblox Studio version 0.605.3.6050660 (64bit)
  • Windows 11 Home version 23H2
3 Likes

Unfortunately, I think this is related to the physics engine and you cannot really do anything about it, the force of the servo is almost flinging your avatar around and we cannot really control the physics engine that much in Roblox.
It’s best to use a SurfaceGui, setting the CFrame of the needle around a axis or something else that does not rely on physics.

I’ve even tried moving everything to the client but the physics engine jank will still occur:


This is just the side-effects of having moving physics object inside of your tools or anything that becomes welded to the character.

2 Likes

Hello WaviestBalloon, I apologise for my late reply as it was nighttime

I do suspect you are correct though, this issue does seem to be an unfortunate limitation of the physics engine

My previous attempts to make the compass work using CFrame was met with two problems which proved to be quite difficult for me to fix, which is why I opted to use a HingeConstraint. The problems were:

  • My character was teleporting whenever the needle moved
  • The CFrame math need was unexpectedly more difficult than I expected, since from my experience there seems to be an offset of sorts when using CFrame on parts welded to the handle of a Tool

I did remember though that I’ve yet to test a version of the compass that uses Motor6D, I will test this and update with my results

It is unfortunate though that physics constraints seem to have this limitation, since it would make the process of making dynamic tools significantly easier

Edit: @WaviestBalloon Here’s the results of my Motor6D test:

  • The shaking problem when equipped is not present
  • The character teleportation issue isn’t present as well, even when aggressively rotating the needle or changing its position

The only problem I have left is trouble with finding the correct method and angle to rotate the needle, but this is due to my lack of experience with Motor6D so I’ll make a topic to ask for help if I don’t find the solution after I experiment some more

I’ll mark you as a solution since as I mentioned I do suspect you are correct, but I do hope that this ticket stays open since it would be nice if in the future it was possible to freely and creatively utilize physics constraints within tools

2 Likes

I played around with this a bit and it looks like the main issue is that the HingeConstraint applies a reaction force to the Humanoid. Normally, this is exactly what you would want a hinge to do but for this application, it applies an extra impulse to the humanoid which causes the shaking. I was hoping the new character controller might give more intuitive behavior for this application since it is physics-based but it gave pretty similar results.

Using a Motor6D is a good way to go as it will remove the physics solver from the equation and give you prescribed motion. If you want to make the compass with constraints, you can create a “Hinge” that doesn’t apply a force to the humanoid by combining an AlignPosition constraint with an AlignOrientation. These two constraints have the ability to turn off reactions so that they only operate on one of the bodies they are attached to (the needle in this case). The main draw back of this approach is that the AlignOrientation does not have a “servo” option so you would need to manipulate the target orientation directly.

1 Like

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