+2 votes

i'm creating a multiplayer game and i have multiple players on the same map, and each one of them needs to have its own camera, but there can apparently only be one active camera in a scene

in Projects by (157 points)

Do you want split-screen?

no, it's online multiplayer

3 Answers

+3 votes
Best answer

ok, so for anyone who is interested i managed to do it by attaching a camera node to my player, then instancing that player scene and spawning it in a map, and then in a player script in ready function i check if isnetworkmaster and execute camera.makecurrent()
and it works fine for me :)

by (157 points)

does this have any drawbacks comparing to ** eugene**'s answer (viewports)?

2 years later and that's exactly what I was looking for :) thanks! Btw, did you ever figure out viewports?

0 votes

You may want to check the document of Viewports.

by (14 points)

i checked it out but i'm not able to make it to work, could you give me a more detailed answer?

0 votes

i know there are two vertions of Godo, one is server and second is the client.

in that case, every client could have its own camera, and the server make them know the position of each one, by network comunication. Make a server with Godot Server (Linux) and try to comunicate the clients on diferent computers, with their own camera.

by (47 points)
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 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 webmaster@godotengine.org with your username.