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

How do I change the orientation of a welded part?

Asked by 3 years ago

I have a shield thats welded to your offhand arm when you equip your weapon, the script is below:

// script.Parent is the tool btw, and the parent of that is player

script.Parent.Changed:Connect(function(c)
    if c == "Parent" and script.Parent.Parent:FindFirstChild("RightHand") ~= nil then
        local handle = script.Parent.Handle2
        local arm = script.Parent.Parent["LeftLowerArm"]
        w = Instance.new("Weld")
        w.Parent = script.Parent.Parent["LeftLowerArm"]
        w.Part0 = w.Parent
        w.Part1 = script.Parent.Handle2


    end
end)

When I equip the shield it faces towards the players arm instead of facing outwardly, how do I change that. I've tried changing the orientation manually by script but that didn't work.

1 answer

Log in to vote
0
Answered by 3 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

Here you go:

--the vector3 angles you change you what you need.
handle.Orientation = Vector3.new(0, 0, 0)

:D

Ad

Answer this question