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

How can I put the camera in a custom position?

Asked by
Vik954 48
5 years ago

I work in some sort of tycoon and I need the camera in a custom position. How can I do it?

0
Please take a look at my method, not to gloat but it’s a lot more efficient and easier to use Ziffixture 6913 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

You should use

local camera = workspace.CurrentCamera
local cframe = CFrame.new(0, 10, 0)
camera.CFrame = cframe

It moves the camera to 0, 10, 0, but you can change it to whatever you like.

You should also look for info about CFrame.Angles to turn the camera where you want.

Ad
Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
5 years ago

This method is known as the Cinema method, wherever you place a brick, the Camera will look in said direction. First, you want a LocalScript, reminder that the Camera or CurrentCamera can only be accessed through this type is Script. Put this in StarterPlayerScripts.

Follow this example

local Cam = workspace.CurrentCamera --// This must be referenced as ‘CurrentCamera’.
local CamPart = workspace:WaitForChild(“CamPart”) --// References to the Part to view from.

After referencing everything, we move to configuration.

Cam.CameraSubject = CamPart --// ‘CameraSubject’ is the part the Camera follows.
Cam.CameraType = Enum.CameraType.Scriptable --// Scriptable makes the Camera freeze.

After configuring, we set the look direction

Can.CoordinateFrame = CFrame.new(position) --// Set’s a custom position from the CamPart.
Cam.Focus = CFrame.new(direction) --// Set’s the direction of where Cam will look.

This is the end, just add everything together and you have a proper Camera Manipulation Script

Hope this helps, if so, press accept answer and upvote! Good Luck

Answer this question