Rope coming out of hand seems to break everything

Hello, so I am making a swinging game, and the rope comes out of the right hand, however when I did this, the player is not able to move anymore, and I have no idea why. Can anybody help? Here is my current code:

function createRope(target, mousepos, isholdingdown)
	if isholdingdown == false then
		Rope:Destroy()
		return
	elseif (char.HumanoidRootPart.Position - mousepos).Magnitude > 1000 then
		return
	elseif isholdingdown == true then
		local A0 = Instance.new('Attachment')
		local A1 = Instance.new('Attachment')
		A0.Parent = workspace.Terrain
		A0.WorldPosition = mousepos
		A1.Parent = player.Character:WaitForChild("RightHand")
		Rope = Instance.new("SpringConstraint")
		Rope.Attachment0 = A0
		Rope.Attachment1 = A1
		Rope.Parent = player.Character:WaitForChild("RightHand")
		Rope.Visible = true
		Rope.LimitsEnabled = true
		Rope.Coils = 0
		Rope.Thickness = 0.1
		Rope.Color = BrickColor.new("Institutional white")
		Rope.MaxLength = (player.Character:WaitForChild("HumanoidRootPart").Position - target.Position).Magnitude
		local VF = Instance.new("VectorForce");
		VF.Name = "SpiderForce";
		VF.Attachment0 = player.Character.PrimaryPart.RootRigAttachment;
		VF.Parent = player.Character.PrimaryPart;

Heres a video capturing it:

Idk why it does this but when it comes out of their HumanoidRootPart, it works perfectly fine.

Pretty sure you cant move the character from places other than HumanoidRootPart, could be very wrong on that tho
Try parenting it to HumanoidRootPart but keep the attachment to the hand and see if it works

Switching the Rope.Parent to HumanoidRootPart, and the A1 attachment to the RightHand doesn’t seem to produce different outcomes sadly.

I’d consider using the class RopeConstraint instead of SpringConstraint, it might work out better and is worth trying.

1 Like

It does look better, I will use RopeConstraints from now on because it revealed a feature I wanted to add later on lol but it still does not work.

just remembered an open source project from a good while ago of something similar to this
hopefully it has some mechanics you can just rip out or learn from
here is a download to the game
open-source-sekiro-grapple-hook.rbxl (76.7 KB)

would provide the forum post but i cannot find it
edit: found it [open source] sekiro grapple hook

1 Like

This model only lerps the player by the HumanoidRootPart. The grapple beam is just for design.

You cannot move while grappling so this may be useless to me.

Apologies, didnt realise that it was made that way

I’ve came up with an idea and it seems to work:

local char = script.Parent
local player = game.Players.LocalPlayer
local Rope

function createRope(target, mousepos, isholdingdown)
	if isholdingdown == false then
		Rope:Destroy()
		return
	elseif (char.HumanoidRootPart.Position - mousepos).Magnitude > 1000 then
		return
	elseif isholdingdown == true then
		local A0 = Instance.new('Attachment')
		local A1 = Instance.new('Attachment')
		A0.Parent = target
		A0.WorldPosition = mousepos
		A1.Parent = player.Character:WaitForChild("fakeHand")
		Rope = Instance.new("SpringConstraint")
		Rope.Attachment0 = A0
		Rope.Attachment1 = A1
		Rope.Parent = player.Character:WaitForChild("fakeHand")
		Rope.Visible = true
		Rope.LimitsEnabled = true
		Rope.Coils = 0
		Rope.Thickness = 0.1
		Rope.Color = BrickColor.new("Institutional white")
		Rope.MaxLength = (player.Character:WaitForChild("HumanoidRootPart").Position - target.Position).Magnitude
		local VF = Instance.new("VectorForce");
		VF.Name = "SpiderForce";
		VF.Attachment0 = player.Character.PrimaryPart.RootRigAttachment;
		VF.Parent = player.Character.PrimaryPart;
	end
end

local fakeHand = game:GetService("ReplicatedStorage"):WaitForChild("fakeHand")

function MakeFakeHand()
	local newHand = fakeHand:Clone()
	newHand.Parent = player.Character
	newHand.CFrame = player.Character:WaitForChild("RightHand").CFrame

	local weld = Instance.new("WeldConstraint", newHand)
	weld.Part0 = newHand
	weld.Part1 = player.Character:WaitForChild("RightHand")
end

MakeFakeHand()

local mouse = game.Players.LocalPlayer:GetMouse()

mouse.Button1Down:Connect(function()
	createRope(mouse.Target, mouse.Hit.Position, true)
end)
mouse.Button1Up:Connect(function()
	createRope(nil, nil, false)
end)

The code above is an edited version of your script, it uses a “Fake hand” that’s welded to the player’s real hand. This way the rope/string is not directly attached to the player, but to the fake hand instead.

1 Like

Thanks for this, I’ll use it and let you know if it works, however, I noticed that you are waiting on a child in ReplicatedStorage? Is this supposed to be a RemoteEvent?

Nope,
It’s just a 1 stud part that’s being cloned. But you might aswell change it to Instance.new() and turn off CanCollide.

1 Like

It works however it seems to be messing with the character a bit.
Here’s a video that shows it:


As you can see the player has a seizure, and in the air it goes to a side a little bit, throwing off the player’s keys so when holding W, they go sideways.