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

How do I make a camera lock somewhere on joined?

Asked by 6 years ago

When someone joins the game, I want their camera to lock onto an object (can not move it) so I can create a menu there. Like it will lock onto looking somewhere and they can select start game and stuff.

Example: On an adventure game it shows an overview of the map

0
Easy fix: make a gui with a textbutton covering whole screen with .99 transparency... Then make sure they cannot zoom in. greatneil80 2647 — 6y
0
well then they cant do anything lol User#23365 30 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

you can use the CurrentCameras CFrame of workspace by changing the CameraType to Scriptable like this:

local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local char = player.Character

wait(0.1)
camera.CameraType = Enum.CameraType.Scriptable -- changes so we can script it
camera.CFrame = workspace.Block.CFrame -- define what Part you want to lock the camera on

also make sure its a local script and your Part is facing your target or whatever. if you want to make the camera go to normal you can just set the CameraType to Custom, such as this:

local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local char = player.Character

camera.CameraType = 'Custom' -- changes it to the default camera
Ad

Answer this question