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

How to fix the orientation of an object when I weld it to my character ?

Asked by
ziAce 15
6 years ago
Edited 6 years ago

So basically when I weld an object to character's legs it only has the right orientation when my character is facing the correct direction. I'm trying to make it have a correct orientation no matter what direction I'm facing.

local function weldtwo(x,y)
        weld  = Instance.new("Weld")
        weld.Name = "WeldE"
        weld.Part0 = x
        weld.C0 = x.CFrame:inverse()
        weld.Part1 = y
        weld.C1 = y.CFrame:inverse()
        weld.Parent = y
    end
    ex1 = folder:findFirstChild("EngineExhausts"):Clone()
    ex1.Parent = leftleg
    ex1.CFrame = leftleg.CFrame *CFrame.new(0,-0.25,0.5)
    ex1.Orientation = Vector3.new(0,90,0)
    weldtwo(leftleg, ex1)

Here's a gyazo gif that shows it. https://gyazo.com/c0233e0a75f0bd5366f93d58b4f10bf5

Thanks a lot for any help.

0
dunno how, but try setting one of the CFrame's rotation relative to the direction of the left leg fanofpixels 718 — 6y

Answer this question