CFrame is not working

workspace.Rocket.Engine.Velocity = Vector3.new(0,0,0)
workspace.Rocket.Body.Velocity = Vector3.new(0,0,0)
workspace.Rocket.Engine.RotVelocity =Vector3.new(0,0,0)
workspace.Rocket.Body.RotVelocity = Vector3.new(0,0,0)

wait()

workspace.Rocket.Body.Anchored = true

wait(1)

local o_x = Rocket.Body.Orientation.X
local o_y = Rocket.Body.Orientation.Y
local o_z = Rocket.Body.Orientation.Z

print(o_x)

wait(1)

local newcframe = Rocket.Body.CFrame * CFrame.Angles(math.rad(-o_x),math.rad(-o_y),math.rad(-o_z))

script.Parent.Parent:SetPrimaryPartCFrame(newcframe)

The rotation values of newcframe should be = 0 but they aren’t and it doesnt make sense, can anyone explain this to me? instead it seems as if it gets a number close to zero but usually off by 3 or more

Orientation and CFrame.Angles apply rotation in a different order.

Orientation applies Euler angles in the order Y, X then Z. CFrame.Angles (alias of CFrame.fromEulerAnglesXYZ) applies angles in the order Z, Y then X.

Try using CFrame.fromOrientation, alias for CFrame.fromEulerAnglesYXZ.

All of the constructors mentioned use radians and it appears you’re currently giving your angles in degrees. You can convert using math.rad and math.deg. In your case convert from degrees to radians using math.rad( o_x ) for example.

You can take a look at the documentation for the constructors which outlines the difference in the order of the applied angles and highlights that the inputs are in radians here: CFrame | Documentation - Roblox Creator Hub

Hey if it’s a model make sure you set the primary part property to the part you want to lift.

Be sure to read the topic before creating a reply. If the primary part were not set, it would error. Instead we’re looking at a case where the rotation occurred, it just ended up at a different rotation than the person expected.

Also nothing is being lifted, it appears to be an issue with rotation not position.