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
you can use the CurrentCamera
s 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