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

How would I make a 2d lockon camera move backwards?

Asked by 4 years ago

I'm trying to make a 2d lockon camera and I have just about everything down except for the camera moving back. I've tried just about everything but nothing so far has helped.

while game:GetService('RunService').RenderStepped:wait() do 
    part.CFrame = CFrame.new((pos1 + pos2)/2 + Vector3.new(0, 5, 0), 
        pos1 + Vector3.new(0, 5, 0)) 
    * CFrame.Angles(0, math.pi/2, 0)
end

The part simulates the camera. It's positioned between the positions of both players and is elevated by 5 studs and rotated 90 degrees. All I'm trying to do now is move it back so both characters are in the FOV of the camera. You can think of this like a 2d lock - on system essentially.

0
So, you want the camera to be in a part? zandefear4 90 — 4y
0
Do you already have code that puts your camera in the part? zandefear4 90 — 4y
0
The part is simulating the camera and Im only positioning it back so both players are in the FOV. I'm trying to make it work in a similar fashion as the Black Magic 2 camera. tentergram 10 — 4y

Answer this question