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

How do I make the player's camera look at something?

So, I'm trying to make a cutscene for my game and I'm trying to make the player's camera move and stuff like that. I have figured out a way on how to make it move but I still can't seem to make the camera look at the place that I want it to look at.

I have read a camera tutorial on how to make it move and look etc. And the tutorial says that to make the camera look at a specific position is to use the Focus property.

So I tried:

game.Workspace.CurrentCamera.Focus = CFrame.new(0,10,0)

But it's still not working? Can someone help me what I'm doing wrong or what I'm missing please? That'd be great :D

1 answer

✓ Accepted answer

Hi Xrp200,

The way to do that is to use the CFrame format of Position and LookAtPosition. It goes like this:

CFrame.new(position, position to look at)

###So, you'd get the camera, and set its CFrame to the position it stays in, and the position it looks at. So, if you wanted the Camera to be at the Center of the game and look completely up. This is how you'd do that.

camera.CFrame = CFrame.new(Vector3.new(0, 0, 0), Vector3.new(0, 15, 0));

##Well, I hope I helped and the above is just an example but, you just need a position for the camera to look at.

Thanks,

Best regards,

~~ KingLoneCat

3 comments

0

Thank you, do you also happen to know how to lock the camera? So that the player can't move it around?

0

Yeah, there's a CameraScript under PlayerScripts, when the player spawns. Just disable that. So, it's inside of the player under a folder called "PlayerScripts", and the script is called "CameraScript". Player > PlayerScripts > CameraScript. Make a .PlayerAdded function that disables that script.

0

Thanks

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