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

Can't change the orientation of a welded part?

Asked by 4 years ago
Edited 4 years ago

I've been trying for hours to rotate a part to 0,0,90, however it is welded to the humanoidrootpart, making it not rotate. I can't understand why, and how would i rotate it while it is welded? Code: (Although not all of it is needed)

game.Players.PlayerAdded:Connect(function(plr)

--Wait for the character
    repeat wait() until workspace:FindFirstChild(plr.Name)

    wait(1)

--Variables
    local char = plr.Character
    local rootpart = char:WaitForChild("HumanoidRootPart")
    local humanoid = char:WaitForChild("Humanoid")
    local HighTorso = char:WaitForChild("UpperTorso")
    local LowTorso = char:WaitForChild("LowerTorso")
--Code
    humanoid.WalkSpeed = 0
    char:MoveTo(workspace.SpawnLocation.Position + Vector3.new(0,3,0))

    rootpart.Orientation = Vector3.new(0,90,0)
    wait()
--Legs
    local RUPPERLEG = char:WaitForChild("RightUpperLeg")
    local RLOWERLEG = char:WaitForChild("RightLowerLeg")
    local RFOOT = char:WaitForChild("RightFoot")
    local LUPPERLEG = char:WaitForChild("LeftUpperLeg")
    local LLOWERLEG = char:WaitForChild("LeftLowerLeg")
    local LFOOT = char:WaitForChild("LeftFoot")

    RUPPERLEG.Transparency = 1
    RLOWERLEG.Transparency = 1
    RFOOT.Transparency = 1
    LUPPERLEG.Transparency = 1
    LLOWERLEG.Transparency = 1
    LFOOT.Transparency = 1

    rootpart.Anchored = true
    local pogo = script.Pogo:Clone()

    pogo.Anchored = true
    pogo.CanCollide = false
    pogo.Orientation = Vector3.new(0,0,90)
    pogo.Parent = char
    pogo.Position = rootpart.Position - Vector3.new(0,2.7,.3)

    wait(5)

    local weldPogoTorso = Instance.new("WeldConstraint", pogo)

    weldPogoTorso.Part0 = char.LowerTorso
    weldPogoTorso.Part1 = pogo

    rootpart.Anchored = false
    pogo.Anchored = false 
    humanoid.WalkSpeed = 16
end)
0
Change the orientation after welding the part MmadProgrammer 35 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Yeah, that's what happen with weldconstraints. Try using Weld and setting their properties C0 and C1 (CFrame values).

Ad

Answer this question