Weird walking physics when attaching part to player with HingeConstraint

I’m attaching a bag (with no collision) to the player’s back that’s meant to have a specific range of motion, as seen below.

jump

This seemed to work exactly as intended, but I began to notice a subtle camera jiggle when walking with the bag attached. It’s easiest to see if you focus on the rock on the right. Below you can see the difference.

With bag:
w bag

No bag:
nobag

I found this thread that appears to solve a similar issue. However, neither of the fixes from that thread removed the jiggle.

I also tried to make the bag Massless, thinking that it might help. This didn’t work either.

Here’s the code for attaching the bag, which is called from the server:

local bag = game.ServerStorage.Bags.Default:FindFirstChild("Bag"):Clone()
bag.CFrame = player.Character.HumanoidRootPart.CFrame
bag.Parent = character
bag:SetNetworkOwner(player)

local a0 = Instance.new("Attachment")
a0.Parent = bag
a0.Position = bag.AttachmentOffset.Value

local a1 = Instance.new("Attachment")
a1.Parent = character:WaitForChild("UpperTorso")
a1.Position = Vector3.new(0, 0.5, 0.7)

local hinge = Instance.new("HingeConstraint")
hinge.Parent = bag
hinge.LimitsEnabled = true
hinge.LowerAngle = 0
hinge.UpperAngle = 90
hinge.Restitution = .2
hinge.Attachment0 = a0
hinge.Attachment1 = a1

Why is this jiggle so persistent? How is it caused by a part with no mass or collision? Any sort of help would be appreciated!

1 Like

The camera is shaking because your character is shaking. And your character is shaking because the bag actually does have some mass which is affecting the movement of the character.

You can try set the BasePart.Massless property on the bag to false. However this may not work because the bag is attached to the character with non rigid joint (you are using a hinge) and counts it as a separate assembly from your character.

If that doesn’t fix it you can try minimizing the mass of the bag by setting it’s density as low as possible.
image

2 Likes