Roblox Camera Orientation/Manipulation?

  1. What do you want to achieve? Keep it simple and clear!
    I’m making a game of checkers. When there are people in both seats ready to play, I would like the players camera to go above the table.

  2. What is the issue? Include screenshots / videos if possible!
    So, I have the camera go above the table which is awesome. But I would like it to be flipped with your side of the table on the bottom end of the screen.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have absolutely no idea how to set the camera to be orientated to the player. Only how to set it to the table position and to raise it.

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable 

local pos = Vector3.new(script.Value.Value.Table.Top.Position.X, script.Value.Value.Table.Top.Position.Y + 5, script.Value.Value.Table.Top.Position.Z)
local lookAt = Vector3.new(script.Value.Value.Table.Top.Position.X, script.Value.Value.Table.Top.Position.Y, script.Value.Value.Table.Top.Position.Z)
local cameraCFrame = CFrame.new(pos, lookAt)

workspace.CurrentCamera.CFrame = cameraCFrame


So that’s fine so far. But the player who is using the red checkers, I would like to see the camera flipped for them with the red on the bottom of their screen and black on the top. Thanks for the help, I imagine this is simple. I just don’t know how to orientate things. I imagine if I turn the table 45 degrees the camera will be off aswell so I should really have it orientated somehow.

1 Like
CFrame.new(currentCamera.CFrame, lookAt.CFrame)

Error: CFrame is not a valid member of Vector3

I obviously don’t know, but I don’t think that would keep it centered above the table either.

1 Like

You could try multiplying the CFrame by CFrame.Angles(0, math.rad(180), 0) to flip the CFrame around 180 degrees.

I could, and I think that’s a way to do it but not the 100% correct way.
If I wanted to make multiple checker tables at different angels in the room, then each script would have to be edited to fit that table. So it has to be orientated to the player somehow I believe and the way they’re looking.

You would just have to set CFrame relative to the board:

plr1: CFrame = board.CFrame * CFrame.new(0, 5, 0)
plr2: CFrame = board.CFrame * CFrame.new(0, 5, 0) * CFrame.Angles(0,math.rad(180),0)

workspace.CurrentCamera.CFrame = script.Value.Value.Table.Top.CFrame * CFrame.new(0, 5, 0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(script.Orien.Value))

This ended up working for me, thanks for helping me get there @K_reex.

1 Like