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

How to rotate the camera in a 2D game?

Asked by 4 years ago

I'm working on a 2D game right now, and what I'm trying to figure out is how to get the camera to rotate around the player.

Here's what I've got. This is a local script located in StarterPlayer.StarterPlayerScripts. CamX, CamY and CamZ are all NumberValues.

01local player = game.Players.LocalPlayer
02local camera = workspace.CurrentCamera
03 
04local val = game.Workspace.Values
05local CamX = val.CamX.Value
06local CamY = val.CamY.Value
07local CamZ = val.CamZ.Value
08 
09player.CharacterAdded:Wait()
10 
11player.Character:WaitForChild("HumanoidRootPart")
12 
13camera.CameraSubject = player.Character.HumanoidRootPart
14camera.CameraType = Enum.CameraType.Attach
15camera.FieldOfView = 40
View all 25 lines...

If you need me to clarify something, I'll be glad to do so! :)

0
what is your problem in your script? Xapelize 2658 — 4y

Answer this question