After creating a new empty game object in the Hierarchy tab, how to give game authority over it?

This is my current problem, which is relevant to this other problem, but not entirely the same.

The “Input Manager” game object is just an empty game object, with a Network Identity component and a script attached to it. I have a feeling that I need to make Input Manager a “prefab”, so I can either register it into the ClientScene, or register it in the Network Manager. I may be incorrect on this one.

Is there a way not to make Input Manager a prefab, yet still allow the client / host to have authority over it?

Thanks in advance.

My understanding is that you can’t.

In a multi-player game, the server owns all. The host is considered a client so even he doesn’t own any GameObject spawned by NetworkServer.Spawn() either.

I haven’t fully tested this yet but I think you have to:

  • [Command] to server
  • so that the server can [ClientCallback]
  • so that the client can handle [ClientRpc]

You do know I was the same guy who posted the [Command] to [Clientcallback] to [ClientRpc] that you liked, right?

Anyway, I was told that I need to inherit Network Manager, overload some event methods, and make it so that it fits what I need to do.

Currently, Unity 5.1 doesn’t support Clients with Local Authorities over multiple prefabs. Unity 5.2 allows this, so I may need to fallback to 5.0 network code, try the 5.2 out, and decide from there. It’s either that, or try writing the Network Manager subclass.