Hello, I am currently developing a ROBLOX Game, and I need assitance on how to change the camera to 2D Locked?
You can use the camera coordinate frame in a localscript inside startergui.
01 | local camera = game.Workspace.CurrentCamera --First we need to get the camera |
02 | local player = game:GetService( "Players" ).LocalPlayer --Next the player |
03 | local character = player.Character or player.Character:Added() --Make sure we got the character! |
04 | --Next we will create a function and name it cameraUpdate! |
05 | function cameraUpdate() --next we get the torso! |
06 | local torso = character:WaitForChild( "Torso" ) --Here is the player's torso! we use WaitForChild just in case they die. |
07 | --Now we can set the camera coordinateframe to all torso cframes! |
08 | camera.CoordinateFrame = CFrame.new(torso.CFrame.X + 8 --[[This is the X position change this to what you want.]] ,torso.CFrame.Y + 2.4 --[[Change 2.4 which is the y value to whatever you like]] , 24 --[[This is the Z value or the distance change it to whatever you like]] ) |
09 | end |
10 |
11 | game:GetService( "RunService" ).RenderStepped:connect(cameraUpdate) --and last we connect the runservice to the function! |
That is it! if this worked your welcome and please accept :D ~KIHeros