I’m trying to create a grapple system but each time I try reducing the length, it looks choppy. I’m reducing the rope constraint by having a wait() loop subtract 1 from the rope’s distance (root.RootRigAttachment.WorldPosition - p2.WorldPosition).Magnitude - 1) but it goes very slow and doesn’t seem like a grapple at all. If I try subtracting anything higher, it’s seems very choppy, which is obviously a bad thing. How would I fix this?
You should be able to use Tweens for this purpose. Varying the the duration to give the effect that you want. The Tween duration should probably be proportional to the length of rope that is being reduced by.
You’d tween the RopeConstraint’s length property as suggested.
Here’s a demonstration:
https://gyazo.com/ee1901976cfd6094da0f6e829dbd13a8
Here’s the script I used:
local tweens = game:GetService("TweenService")
local rope = script.Parent
task.wait(10)
local tween = tweens:Create(rope, TweenInfo.new(1.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Length = 2})
tween:Play()
Finally, here’s the “.rbxm” file for reproduction purposes:
repro.rbxm (4.6 KB)