Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

RopeConstraint gets my character stuck, bug or script issue?

Asked by 5 years ago
Edited 5 years ago

I have a rope shooting script and whenever I shoot a rope I get stuck. I am using RopeConstraint for that. I have no idea why I am getting stuck tho. Any idea? Is it a bug or I have to change something to fix it?

1) https://vimeo.com/297590277

2) https://vimeo.com/297449574 (Any time I get close to my clone I can move yet when I leave him I get stuck again..)

--// Variables

local players = game:GetService("Players") 
local plr = players.LocalPlayer

local char = plr.Character
local head = char:FindFirstChild("Head")

local athA = Instance.new("Attachment") 
local athPart = game.Workspace.AttachPart --This is a specific part that the rope attaches to
local athB = Instance.new("Attachment")
athB.Parent = athPart 
athA.Position = Vector3.new(0,0,-1)
athA.Parent = head
local length 
local uis = game:GetService("UserInputService")
isSwinging = false

--// Functions:

uis.InputBegan:Connect(function(key) 
    if key.KeyCode == Enum.KeyCode.R  then
        if isSwinging == false then
            isSwinging = true
            script.WebSound:Play()
            wait(0.1)
            rope = Instance.new("RopeConstraint")
            length = (head.Position - athPart.Position).magnitude
            rope.Attachment0 = athB
            rope.Attachment1 = athA
            rope.Length = length
            rope.Visible = true 
            rope.Parent = head
        end
    end
end)

uis.InputEnded:Connect(function(key)
    if key.KeyCode == Enum.KeyCode.R then
        if isSwinging == true then
            rope:Destroy()
            isSwinging = false
        end
    end
end)
0
Try changing the state of the Humanoid. char.Humanoid:ChangeState(Enum.HumanoidStateType.Physics) or another state. NotInventedHere 158 — 5y
0
nice r u trying to make an AoT game on roblox? TheluaBanana 946 — 5y
0
I have no idea whats "Physics" is. Any explanation please? HeyItzDanniee 252 — 5y
0
@TheLuaBanana Actully no lol I dont like AoT. HeyItzDanniee 252 — 5y

Answer this question