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

How to rotate a welded part?

Asked by 5 years ago
1local HORN  = script.Horn:Clone()
2HORN.Parent = workspace
3HORN.Orientation = Vector3.new(-50.33, -87.83, 0)
4local hornWeld = Instance.new("Weld")
5hornWeld.Parent = workspace
6hornWeld.Part0 = c.Head
7hornWeld.Part1 = HORN
8hornWeld.C0 = CFrame.new(.08,.6,.6)       

The weld works correctly but the horn isn't rotated as i want it to be like, how do you rotate the horn even tough it's in a weld?

0
CFrame * CFrame.Angles() DeceptiveCaster 3761 — 5y

1 answer

Log in to vote
1
Answered by
IDKBlox 349 Moderation Voter
5 years ago

CFrame.Angles() is what you're going to want.

When you're setting the hornWeld.C0 add * CFrame.Angles() and set x,y,z values to what you'd like

1hornWeld.C0 = CFrame.new(.08,.6,.6) * CFrame.Angles(0,math.rad(90),0)
Ad

Answer this question