RopeConstraint in Tool causes character to glitch

Hello,

I am working on a gas pump for my game and the way it works is the player clicks F in order to get a “Gas” tool with a ropeconstraint attached to gas pump in order to make a dynamic “hose”. However whenever the tool is equipped it glitches the player to the ground.

Note: I am aware of existing topics but none of them have a valid solution to this problem.

Solutions I tried are as listed:

  • Delay attaching the Constraint
  • Set Restitution to 1
  • Anchoring the Player for a brief moment when equipped
  • Setting the parent of constraint before setting Attachment1

And none of these have worked out.

Current Script:

local new = Tool:Clone()

new.Parent = Player.Backpack

Player.Character.Humanoid:EquipTool(new)

local newConstraint = Instance.new("RopeConstraint")

newConstraint.Thickness = 0.15

newConstraint.Color = BrickColor.new("Black")

newConstraint.Visible = true

newConstraint.Enabled = true

newConstraint.Length = 10

newConstraint.Restitution = 1

newConstraint.Attachment1 = script.Parent.Parent.Parent.Parent.Parent:FindFirstChild("ToolAttach"):FindFirstChild("StartAttach")

newConstraint.Parent = new.Handle

delay(.15, function()

newConstraint.Attachment0 = new.Attach.EndAttach

end)

Video:

https://i.gyazo.com/25d30b1fdee51827369349094a93c4f2.mp4

I would appreciate finally getting a solution to this problem. :grin:

2 Likes

I was going to suggest anchroing the player for a brief moment while attaching the constraint, but you said you already tried that… What behavior did you see when you tried that fix? Did the player just fall over when you unanchored the character model?

If nothing else works, you could always just create a part which isn’t attached to the character model in anyway however you add a BodyPosition and BodyGyro in it so that it will position itself at the same position and rotation as the character’s arm. This would mitigate any forces exerted on the character model.

but are you sure you’re playing well with properties?

Make sure that all Parts in the tool have the Property ‘Massless’ selected so that the physics don’t involve that.
You could also try removing the RopeConstraint to see if that is actually causing the issue or if it’s something else.

If the “gas” weighs too much, the player will be all glitchy

Yes, that is what I meant, try, surely there is some wrong ownership

Cos’è il “maseless”? Never heard before
(Edit: Understood by translating)

When unanchored the character just fllipped like if there was no anchoring involved.

Everything is massless, and the ropeconstraint is the issue as it did not glitch out otherwise.

You’ve made the Length of the rope 10 studs. What is the length between the Attachments when you equip the tool? What are the Attachments attached to on either end?
If the Length is too short then it definitely will pull the player when the tool is equipped.

I’d suggest having the nozzle with the RopeConstraint mounted on the pump when not equipped, and when it’s equipped just weld it to the players hand so that nothing is being created at the moment that happens.

Or try using a SpringConstraint with no Force in it, and the spring diameter set to zero. I’ve used this setup for crane cables so they don’t have to constantly change length.

I also tried to put something ridicolous like 10,000 studs and it has the same error.

Hello, I have had the same problem, but it makes the character unable to animate movement. It does work to move, but the physics gets all wierd, you can see it in the video below:

Video (Gyazo)

You cannot see the video, but when the character tries to get up it just starts to spin uncontrollably.

Update the length so the character doesn’t get pulled to the object

Was a fix found for this issue? I am having the same problem with my Rope Constraint attaching to a tool.

3 Likes