Hello.
I have a problem with my script, so I want to rotate a cilinder 90° degrees, the cilinder is behind of the character’s head and it should look like some clock behind them, but the problem is that I try to rotate it 90° degrees but it just seems to rotate a bit more or a bit less. Then I tried playing with the degrees and aumenting 0.01 in the math.deg() would make a drastical change. How do I fix this? Here is the code:
local function CreateClock(Character: Model?): Part
local Part = Instance.new("Part")
Part.Shape = Enum.PartType.Cylinder
Part.CFrame = Character.PrimaryPart.CFrame * CFrame.new(0, 0, 1)
Part.CFrame = Part.CFrame * CFrame.Angles(0, math.deg(90), 0) -- issue
Part.Size = Vector3.new(0.05, 3.06, 3.06)
Part.CanCollide = false
Part.CastShadow = false
Part.Color = Color3.fromRGB(255, 0, 0)
Part.Name = "Clock"
Part.Parent = Character.PrimaryPart
return Part
end
return CreateClock
(Note that this creates and sets the position of the clock, the script that calls this module creates a WeldConstraint)
How it is:
How I want it to be:
Your help would be REALLY appreciated, thanks.