I have a rooster that changes the direction it faces over time. I have a specific heading, from 0 to 360 (0 for north, 180 for south) which indicates the orientation of the rooster. How do I make the rooster face this particular heading?
Edit: Here’s the code I’m working with:
local cf = rooster.PrimaryPart.CFrame - rooster.PrimaryPart.CFrame.Position
local x, y, z = cf:ToEulerAnglesXYZ()
local newCF = CFrame.Angles(x, y + wind["heading"], z)
print(newCF)
rooster:SetPrimaryPartCFrame(newCF)
