How do i make a camera that stays within range of two charcters

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LJ INFINITY

How do i make a camera that stays in range of two characters and increasing or decreasing depending on the two characters position?

There’s a KidsCanCode tutorial on that one, check it out: https://www.youtube.com/watch?v=W7WsL3qaPqg

Also (and I’m assuming you’re making some sort of fighting game), if you want to go one step further and copy the camera of those old dragon ball 16-bit era fighting games (if the two players are far apart, the camera splits the screen in two), the
2D Platformer Demo (KinematicBody) 2D Platformer Demo (KinematicBody) - Godot Asset Library has an example of split screen with two players (run the example and press “tab”)

Good luck!

cronodia | 2021-09-09 00:20

Do you already have a camera running that is setting the position to one of the character’s positions? You just need to take an average of the two Vector2’s of each character and position the camera there.

Polatrite | 2021-09-09 00:19