Question by
jezozwiesh · Sep 06, 2020 at 10:45 AM ·
cameranetworkingmultiplayer-networkingmirrormultiple cameras
How to make multiplayer with multiple local cameras?
Hello, so I started with unity and I want to make 2D top down multiplayer shooter. I'm using mirror and I want to players have their own camera. I researched whole internet about multiple client-side cameras but with no effect. How to do that?
Thanks in advance.
Comment
Answer by iGoA · Dec 30, 2020 at 12:43 PM
I'm relatively new to mirror, too. As far as I understand, you should have only one camera, but you have to control it only by the local player. Usually the player object of the local player has authority while the other player objects don't. So you could check for hasAuthority. For example, in your player objects Update method do something like this:
public void Update() {
// ...
if (hasAuthority) {
// move the camera to follow this game object
}
}