Hello guys, I have a problem and I dont know how to solve it. Maybe ist because am a rookie in programming. Here is the thing; I have one Scene an two cameras. Camera one is attached on a simple fps Controller. Camera two is simply staying in the sky. There is no possiblity to control that cam (so is the plan). So far so good. What I try to do is, that the FPSController cam is controlled by the host and every client, who joins the game should spawn in camera two. I just want Clients to watch. I tried things like isClient, isServer commands but my understanding for C# is not high enoug to know what im doing there. Can anybody tell me what code lines I need to do that? and where they should be attached to. I have no idea what can do. hope you guys can help me. Thanks!
First choose who is the host. Maybe the first player that connects will be the host. So check if there is any players on the server. If not. FpsCamera.enabled = true; SkyCamera.enabled = false; And if there is other players online, Other way around. That's just an example to get you started. But too be honest. I think you need to understand how Unet Works before you start. What is a server? What is a client? How can you run code on server etc. Read the documentation and if there is something you don't understand I'm willing to help you.
Hey, I have a similar Idea but I am trying to make the Server as a spectator for a game where the Client plays in VR. If you were able to make something happen even for 3d Game, can you share some helpful tips?
UNET has died since this post. It's going to be removed. You can check out my own networking library.
If only the server will be using this spectator camera, there is no need for this camera to be part of the scene or exist on the clients. Nor should there be a need for it to be a networked GameObject. Just instantiate the spectator camera from a prefab if IsServer is true. But as @TwoTen said, Unet has been marked Obsolete. Unless your game is already close to completion you should be moving to an alternative network API.