Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't the object get correctly oriented?

local roar = Instance.new("Part")
	roar.Name = "Roar"
	roar.BrickColor = BrickColor.new("Light blue")
	roar.Material = "Neon"
	roar.Transparency = 0
	roar.FormFactor = "Custom"
	roar.Size = Vector3.new(2,2,0)
	roar.CanCollide = false
	roar.Anchored = true
	roar.Parent = player.Character.Head
	roar.Shape = "Cylinder"
	roar.Orientation = Vector3.new(0,90,0)
	roar.CFrame = player.Character.Head.CFrame + Vector3.new(3,0,0)

The object just keeps it's orientation no matter what i put in the vector3.new bracket

1 answer

✓ Accepted answer

The problem is that CFrame is rotation and position. You set Orientation but CFrame will override it on the next line.

You can include the rotation in the CFrame

local cf = player.Character.Head.CFrame + Vector3.new(3,0,0) 
-- Angles use radians not degrees so we convert them
roar.CFrame = cf * CFrame.Angles(0, math.rad(90), 0)

Hope this helps.

2 comments

0

Works exactly as intended, thank you!

1

No problem.

This discussion is preserved as it was. New answers, comments, and votes are closed.