When I try changing the orientation of my model it doesn’t work it just resets back in an instant.
I’m trying to create sort of an egg hatching system and rotate the pet when hatched put for some reason it doesn’t want to add to the old rotation it stays still.
Using CFrame.fromEulerAngles without the second argument is equivalent to using CFrame.fromEulerAnglesXYZ, and CFrame.Angles is also equivalent to using CFrame.fromEulerAnglesXYZ, so is there a specific reason as to why you’re using CFrame.fromEulerAngles in the first example? Since CFrame.Angles uses the same rotation order and it’s working correctly for you, you should use it instead
Doing something like this should work to make newDumbell rotate on the Y axis:
local RunService = game:GetService("RunService")
local RAD_PER_SEC = math.rad(50) -- This will make newDumbell rotate 50 degrees per second
local newDumbell = -- The newDumbell Model
local newDumbellPivot = newDumbell:GetPivot() -- We'll need to store the newDumbell's original pivot
local angle = 0
RunService.Heartbeat:Connect(function(deltaTime: number)
angle += RAD_PER_SEC * deltaTime
newDumbell:PivotTo(newDumbellPivot * CFrame.Angles(0, angle, 0)) -- Angle is in radians already, so no need to convert it
end)
Remember to disconnect the heartbeat loop if it’s no longer required
local newDumbbellPivot = newDumbell:GetPivot()
dumbbellConnection = runService.Heartbeat:Connect(function(deltaTime: number)
dumbellAngleAmount += dumbellRotateSpeed * deltaTime
local cf = CFrame.new(0,0,-normalDumbbell.PrimaryPart.Size.Z * 3) * CFrame.Angles(0, dumbellAngleAmount, 0)
newDumbell:PivotTo(camera.CFrame * cf) -- Angle is in radians already, so no need to convert it
end)