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

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

--What it should look like:
CFrame.Angles(...)

--What you're probably doing:
local CoordinateFrame = CFrame.new(...)
CoordinateFrame.Angles(...)
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")
game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
	local rot = char:WaitForChild("UpperTorso",math.huge):WaitForChild("rot",math.huge)
	print("found")
	local db = true
	run.RenderStepped:Connect(function()
		if db == true then
			db = false
			local ang = workspace.CurrentCamera.CFrame.LookVector.Y * 90 * -1
			rot.UpperAngle = ang
			rot.LowerAngle = ang
			db = true
			print(workspace.CurrentCamera.CFrame.Angles)
		end
	end)
end)

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