Changing The Camera's View

From Legacy Roblox Wiki
Jump to navigationJump to search

Introduction

This tutorial will show you how to change your viewpoint in Roblox using the command line or a script.

How do I make a new camera

  • Click insert.

  • Click Object.

  • In your Explorer window, a new camera should appear.

How to Change the Camera's View

There are several properties in a Camera object.

CoordinateFrame

[camera].Coordinateframe = CFrame.new(?)

game.Workspace.Camera.CoordinateFrame = CFrame.new(150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0) will take your camera to the coordinates (150, 150, 150).

Use print(game.Workspace.Camera.CoordinateFrame) to verify this.

Focus

1) [camera].Focus = CFrame.new(?)

game.Workspace.Camera.Focus = CFrame.new(0, 0, 0) will change the direction of what you are looking at to (0,0,0).
game.Workspace.Camera.Focus = CFrame.new(150, 150, 150) will change the direction to (150, 150, 150).

Use print(game.Workspace.Camera.Focus) to verify this.

CameraSubject

game.Workspace.Camera.CameraSubject = game.Workspace.Part sets what the Camera is looking at.

print(game.Workspace.Camera.CameraSubject) will print "Part".

This may not make much sense until you change the CameraType to "Attach". (See next section).

CameraType

game.Workspace.Camera.CameraType = 1

print(game.Workspace.Camera.CameraType)

Camera Focus

game.Workspace.Camera.Focus = CFrame.new(... insert your CFrame here ...)

print(game.Workspace.Camera.Focus)

See Also

Camera