How do I Create a camera angle so that it is always to the side of the player?
( Like a 2D side scrolling game) Help appreciated , thanks :)
How do I Create a camera angle so that it is always to the side of the player?
( Like a 2D side scrolling game) Help appreciated , thanks :)
To do this then you can lock the z axis of the camera so that it's always at a certain position, then use Camera Interpolation in a while loop to set the Camera relative to the player.
local cam = workspace.CurrentCamera
local reference = game.Players.LocalPlayer.Character.Torso
local z = CFrame.new(0,0,0) --Lock z to this point
cam.CameraType = 'Scriptable'
while wait() do
cam:Interpolate(
CFrame.new(reference.CFrame.p.X,reference.CFrame.p.Y,z),
reference.CFrame,
.3
)
end
To read more about Camera Interpolation, click this.
When i Insert this into a local script it does not work
You don't have a variable for the camera therefore you'll need to do this!!!This goes before your script three lines apart!!!
Cam = game.workspace.Camera
Hope it works for you!
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
DeviousDeviation created a model that automatically makes the camera side-scrolling. I suggest checking it out.