What's the maximum rotation for the currentcamera cframe?

what’s the maximum rotation for the currentcamera cframe? I am making a cutscene and it looks like when i put big numbers, it is stuck at a limit, so what is the limit? or the maximum rotation?

im talking about the orientation (lookat)

workspace.CurrentCamera.CFrame = CFrame.new(pos,lookAt)

seems like when it has limits when I put numbers that are huge

The lookAt argument is not an orientation value, it’s a vector.

If you imagine a line is drawn between the two vectors, the rotation of the CFrame is set up such that the LookVector of the CFrame is parallel to that imaginary line.

yes, the vector part of the lookAt, what’s the limit-eh

it seems that it only goes 90 degrees maximum left or right, so does that mean the vector is 90?

There isn’t a limit, CFrames can point in any orientation, though using that particular constructor always provides a roll angle that results in the camera horizon to be horizontal, which for a camera is generally pretty useful.

Perhaps if you provide your specific code we can find the solution. Your assumption that there’s a limit is incorrect and might be preventing you from finding the actual issue.

workspace.CurrentCamera.CFrame = CFrame.new(pos,lookAt)

im talking about this limit, the one in the wikis,

That’s not a limit, that’s a piece of code taken straight from the developer hub. Please provide your code so I can find where the issue is.

There is no issue or limit with the code snippet itself being limited at 90 degrees, I use it all the time. The issue is in your usage of the constructor, not the constructor itself, so I am asking to see your usage of it.

local part = workspace.part
local pos = part.Position

workspace.CurrentCamera.CFrame = CFrame.new(pos,Vector3.new(0,0,0))

it isn’t facing straight, the part is straight, the axis is, but not the camera.

So that piece of code will place the camera at the position of the part, looking at the origin, provided the CameraType is set to Scriptable.

Double check the CameraType of the camera, and that you want it to be placed at the part and look to the origin.

workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable

local part = workspace.part
local pos = part.Position

workspace.CurrentCamera.CFrame = CFrame.new(pos,Vector3.new(0,0,0))

this is what i did, the part was anchored, (to make sure it doesnt move) and the camera still starts slighty to the left

In other words, first of all, the Part is in the right place and it is directly facing the Z axis (the front).

second of all, this is what happens when i test it

as you can see, it is not facing the correct direction

workspace.CurrentCamera.CFrame = CFrame.new(pos,poslookat)

https://gyazo.com/e2c608a9f49606452d321f575844aaf3

poslookat is the position you want to look at.

Your part is positioned at 20.25, 8.75, 32.25

Imagine it from above, looking down at the X-Z plane.

The code is doing exactly what you’ve told it to. Describe what you expected the outcome to be on the grid and then I can advise you on the correct code.

1 Like