Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make the Camera look downwards?

local Target = Workspace.IntroCamPart
local Cam = Workspace.CurrentCamera
Cam.CameraType = "Scriptable"
Cam.CameraSubject = Target
local Angle = 0
 
while wait() do
    Cam.CoordinateFrame = CFrame.new(Target.Position) * CFrame.Angles(0, Angle, 0) * CFrame.new(0, 0, 5)
    Angle = Angle + math.rad(1)
end

1 answer

To make the camera look down, you can rotate it by -90 degrees on the X-axis. So you would have:

Cam.CoordinateFrame = CFrame.new(Target.Position) * CFrame.Angles(0, Angle, 0) * CFrame.Angles(-math.rad(80), 0, 0) * CFrame.new(0, 0, 5);

11 comments

0

I don't understand that at all. If you want can you explain it?

0

Sure, so I used your line but before I offset it backward by 5 studs, I rotate it -90 degrees on the x-axis. So it rotates on the y-axis to angle (which you had originally) and after rotating it by the y-axis, we rotate by the x-axis (to tilt it) 90 degrees.

0

Sorry, I meant -90 degrees (my last sentence).

0

Im stupid, sorry. I wanted it to spin at the ground... I'm so sorry. If you dont want to answer, you dont have to.

0

Oh, I thought you wanted to do what you posted and just tilt it. So you don't want it to spin (while looking down) on the Target?

0

I'll see if I can make it spin.

0

Oh I just tested the script and it didn't work. Weird I used this exact same line before and it used to work fine. 1 second let me fix it.

0

I have no idea what I'm doing.. The math.pi thing is confusing me.. pi = 3.14 right? It's to find out circuference or something?

0

No, math.pi is 180 degrees (since CFrame.Angles takes radians, think of it as math.rad(-90) [which would be -math.pi/2]

0

Yeah this is weird, I don't think I ever had this problem before. Apparently tilting resets the rotation (y-axis) for some reason I guess?

0

Well tilting by 80 degrees seemed to fix it, I updated the code.

This discussion is preserved as it was. New answers, comments, and votes are closed.