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

Side Scrolling Camera? [closed]

Asked by 10 years ago

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 :)

0
DeviousDeviation created a model that automatically makes the camera side-scrolling. I suggest checking it out. FearMeIAmLag 1161 — 10y

Closed as Not Constructive by EzraNehemiah_TF2, Goulstem, and TurboFusion

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

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.

0
When i Insert this into a local script it does not work Bubbles5610 217 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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!