How to create a rope similar to what you would see in spiderman?

So if you’ve ever seen and movie where spiderman is web swinging, it looks real cool and fast paced. I want to create something like this, or at least similar. I’ve made a local script that detects if you are hovering over a part, and if you press while hovering it, it creates a rope constraint via the server. Here is the server script (the local script is irrelevant)

game.ReplicatedStorage.CreatePart.OnServerEvent:Connect(function(player, PTR)
	local Rope = Instance.new('RopeConstraint')
	local A0 = Instance.new('Attachment')
	local A1 = Instance.new('Attachment')
	A0.Parent = PTR 
	A1.Parent = player.Character["Right Arm"]
	Rope.Attachment0 = A0
	Rope.Attachment1 = A1
	Rope.Parent = player.Character
	Rope.Visible = true
	Rope.Length = 12
end)

As you can see, it’s not really the smoothest swing ever (Don’t mind the weird animation, I’ma fix it soon)

How can I achieve my goal?

1 Like

I’ve made a spiderman game before, I’m not sure if there’s a better way now.

What I did was I used I believe spring constraints for the webs, and connected it to the HumanoidRootPart. Then made a fake web and attached it to the hand

(THIS IS VERY OLD AND OUTDATED)

1 Like

is that a fellow parkour fan?

I tried as you said (not too worried about the fake web yet), and here the code.

local Rope = Instance.new('SpringConstraint')
	local A0 = Instance.new('Attachment')
	local A1 = Instance.new('Attachment')
	A0.Parent = PTR 
	A1.Parent = player.Character.HumanoidRootPart
	Rope.Attachment0 = A0
	Rope.Attachment1 = A1
	Rope.Parent = player.Character
	Rope.Visible = true
	Rope.LimitsEnabled = true
	Rope.MaxLength = 14

And the result looks like this:

How do I do crazy swings like yours? Increase the walkspeed?

1 Like

I feel like a number of things need to be changed but I don’t script so I wouldn’t know

I feel like beams would be your best bet!

beams? how do i get it to do the swing?

make the constraint invisible
char lim hahsah

no i mean how do i get it do swinging like ropeconstraints and stringconstraints?

I used a body velocity and set it to their humanoids MoveDirection then multiplied it by like 26 or something

set what to to the movedirection, bodyvelocity.P?

local BV = Instance.new('BodyVelocity')
while true do
	BV.Velocity = Vector3.new(player.Character.Humanoid.MoveDirection * 26)
	wait(0.1)
end
BV.Parent = player.Character.HumanoidRootPart

I’m trying to update the bv.velocity every 0.01s, but it’s not creating the BV. Help?

Put the BV.Parent = player.Character.HumanoidRootPart part before your loop, it won’t run otherwise.

the while loop is yielding the script before it can parent it.

also it would be better do do a connection here:

local BV = Instance.new('BodyVelocity')
local char = player.Character

char:WaitForChild("Humanoid"):GetPropertyChangedSignal("MoveDirection"):Connect(function()
	BV.Velocity = player.Character.Humanoid.MoveDirection * 26
end)

BV.Parent = char.HumanoidRootPart

This will update the body velocity only when the move direction changes

3 Likes

What’s up with it not updating the Y axis?

Just realized that MoveDirection doesn’t have a Y axis associated with it really. How would I still get the swinging feature with your script, the script only works with the X and Z axis.

BodyVelocity.MaxForce = Vector3.new(1000000,0,1000000)

should fix it

Also last question, how do I stop this from happening (the violent shake of the character)

Check your walkspeed. That might be the issue.

I set it to different walkspeeds, and that didn’t work for me.

Can i have a RBXL file? Make sure it only comes with the web swing