The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

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

in Engine by (25 points)

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.

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) https://godotengine.org/asset-library/asset/120 has an example of split screen with two players (run the example and press "tab")

Good luck!

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.