I have a NetworkIdentity that is created at runtime via Spawn() that needs to then be assigned local authority to the "owning player" based on who made the initial request to spawn the object. Assigning localPlayerAuthority to true locally for the owning player and then calling AssignClientAuthority(connection) results in an error message in the console saying "failed to find message handler for message ID 15". The connection argument I am using is the one created by StartHost() or StartClient(). I'm assuming that I need to do this because none of my remote actions are being called on the server when the client calls them locally for these objects. What is the correct method for dynamically assigning client authority to objects spawned at runtime?
There are two ways : 1) SpawnWithClientAuthority : NetworkServer.SpawnWithClientAuthority(gameObject, connectionToClient); This spawns an object like NetworkServer.Spawn() but also assigns Client Authority to the specified client. http://docs.unity3d.com/ScriptReference/Networking.NetworkServer.SpawnWithClientAuthority.html 2) AssignClientAuthority (which you tried) NetworkIdentity.AssignClientAuthority(connection); http://docs.unity3d.com/ScriptReference/Networking.NetworkIdentity.AssignClientAuthority.html In the doc example, the connection argument is the client connection.
Did you read my post? I tried AssignClientAuthority and got an error about not having a handler for message type 15. I ended up refactoring and using SpawnWithClientAuthority when no one replied here.