Angles is not a valid member of CFrame

Uhhhh, Am not sure if Angles is deprecated or not, maybe I didn’t catch up on news?
Am not sure why this glitch is throwing up, What are the alternatives i can use?
Screenshot 2021-03-10 163313

1 Like

You’re probably indexing “Angles” on a CFrame value instead of the CFrame global.

--What it should look like:

--What you're probably doing:
local CoordinateFrame =
1 Like

You can just do the following to get your angles:

local x, y, z = MyCFrame:ToEulerAnglesXYZ()

And this to apply new angles:

MyCFrame = CFrame.Angles(rx, ry, rz)  -- CFrame.fromEulerAnglesXYZ() also works

Nope, I tried directly indexing it and didn’t work-

What’s the code then, if you still have the issue?

Sorry for the late reply again, here’s the code btw!

local run = game:GetService("RunService")
	local rot = char:WaitForChild("UpperTorso",math.huge):WaitForChild("rot",math.huge)
	local db = true
		if db == true then
			db = false
			local ang = workspace.CurrentCamera.CFrame.LookVector.Y * 90 * -1
			rot.UpperAngle = ang
			rot.LowerAngle = ang
			db = true

Angles isn’t a property of a CFrame, you will have to get the orientation of the camera another way.

And what’s the “other way?” :cold_sweat:

Probably getting the lookvector of the cframe.

But I want certain axes, and I realized it wasn’t suitable exactly.

XYZ is not a good way to handle rotation largely do to gimbal lock and other funny business. XYZ just doesnt contain enough information. But it’s simple, so if you want to you can use this.

local x,y,z = camera.CFeame:toAxisAngle()
1 Like