CFrame orientation being off

HELP! I want to make an intro cutscene but when I load in the camera’s orientation is wrong.

Here is the script:

local Controls = require(LocalPlayer.PlayerScripts.PlayerModule):GetControls()

Controls:Disable()

local camera = workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Scriptable

camera.CFrame = CFrame.new(4,6.5,4.5)

camera.CFrame *= CFrame.Angles(math.rad(-14.5),math.rad(-40),math.rad(0))

I have printed the math.rad() normally and it seems to work fine, but when i use it here, instead of getting the orientation as -14.5,-40,0 I get -11.058, -40.916, 9.438.

I don’t understand why this is happening, maybe someone who knows how CFrames or radians work better than me can tell me what to do.

Clip:

2 Likes

I have a question: Should the camera be sideways like this, or straight?

The rotation on the Y axis should be global, and the rotation on the X axis should be local.

camera.CFrame = CFrame.new(4,6.5,4.5)
camera.CFrame *= CFrame.Angles(0, math.rad(-40), 0) * CFrame.Angles(math.rad(-14.5), 0, 0)

It might seem like the same thing, but it’s not. When you do camera.CFrame = CFrame.new(4,6.5,4.5), the camera has no rotation yet, so the next rotation you apply (the Y rotation) will be global. After that, any rotations will be local.
You can get the same result by using other transformations, but in this case, this is the simplest way.

1 Like

You are really so fast, i was waiting for answer from TheStickminKing :sweat_smile:

It is supposed to be straight also 30charlimit

1 Like

I have no idea what this all means but i’ll try it

1 Like

Oh yay it does infact work and i am stretching this out becuase of the limit

1 Like

I dont understand why it has to be so difficult though…

1 Like

“This is the way”
Good luck!
.

1 Like

you need to use CFrame:ToWorldSpace instead of these unclear shenanigans with ‘Y axis should be global’

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.