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

How Do I make the Camera focus on 1 spot?

Asked by 8 years ago

So I'm making a Title screen and I am wondering How do i make the camera focus on 1 spot forever (I'm gonna make it so they get placed in a diff place)

1 answer

Log in to vote
1
Answered by
Async_io 908 Moderation Voter
8 years ago
Edited 8 years ago

First thing's first. CAMERA MANIPULATION IS THE HARDEST THING FOR NEW SCRIPTERS

There are more than 3 questions every day for camera manipulation issues, datastore being it's equal in difficulty.

Camera Manipulation is one of the things I hated most in scripting.

Basics

Camera Manipulation scripts need to be local scripts.

CurrentCamera is an extremely important invisible component to camera manipulation. This is the thing you'll be using most. CameraType is also important. There are multiple types of ways the camera will focus on the area. This is an extremely useful video. CoordinateFrame is an extremely important item you'll need for camera manipulation. This is used for setting the position of the camera, the rotation, etc.

Script

This is an example script displaying how the elements are used.

local target = workspace.Part --Useful variable for defining a target
local camera = workspace.CurrentCamera --Gets the current camera from the workspace
camera.CameraType = Enum.CameraType.Scriptable --Sets the camera type. Scriptable makes it so the camera doesn't move at all when the position is set
camera.CameraSubject = target -- Sets the target for the camera 
    camera.CoordinateFrame = CFrame.new(target.Position)  --Start at the position of the part
                           * CFrame.Angles(0, 0, 0) --Rotation
                           * CFrame.new(0, 0, 5)       --Move the camera backwards 5 units
--Script was borrowed from wiki for example. I removed the while loop that comes with it. 

Useful links

ROBLOX Wiki for Camera Manipulation

ROBLOX Wiki for Camera Type

Camera Manipulation Video Tutorial

Ad

Answer this question