Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to fix a players camera in one set spot?

Asked by 9 years ago

I'm trying to make a Five Nights at Freddy's type game, with the player's camera fixed in one spot right in front of the desk, but I can't figure out how.

Could someone help me with exactly how to do it?

1 answer

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
9 years ago

You'll need to change the camera's type to scriptable and then set the coordinates and rotation you want the camera to face in.

-- In a local script
local camera = game.Workspace.CurrentCamera

camera.Type = Enum.CameraType.Scriptable
camera.CoordinateFrame = CFame.new(x, z, y) * CFrame.new(rx, ry, rz) -- Set the CFrame and Rotation of Camera manually

If you didn't want to set the CFrame manually, you could instead set a block's CFrame and lookVector to the position you want the camera to go to and then make the Camera's CFrame equal to the Block's CFrame.

0
Just a question: Where would I put this local script? Just in the plain Workspace? ImmenseKassing 120 — 9y
0
Local scripts must be run in a local environment: such as the Player's Backpack or PlayerGui BlackJPI 2658 — 9y
Ad

Answer this question