#Help player!
8 messages · Page 1 of 1 (latest)
Of course 🙂
You can either use separate prefebs, or same prefabs and just hide mesh/dont run some code, depending on what mode they're in.
Perfect, so I would need to customize the network manager and override the AddServerPlayer function to instantiate the correct spectator or player client? Or is there a different way?
Yes thats fine.
We have a examples/character selection
for reference, along with the Docs pages too.
I would like to understand how to assign authority to a client because there used to be a checkbox, but now it's not there anymore. For example, on the transform there was client authority. Is it the same thing if now there's sync direction set to client-server?
NetworkServer.AddPlayerForConnection(connection, prefab)
When you spawn player using AddPlayerForConnection()
The conn is granted authority over the prefab, in NetworkServer.cs
conn.identity = identity;
// Set the connection on the NetworkIdentity on the server, NetworkIdentity.SetLocalPlayer is not called on the server (it is on clients)
identity.SetClientOwner(conn);
Yes sync direction, client to server.
Thanks for the reply. So is this irrelevant?
csharp
NetworkServer.AddPlayerForConnection(conn, playerObject);
NetworkIdentity networkIdentity = playerObject.GetComponent<NetworkIdentity>();
if (networkIdentity != null)
{
networkIdentity.AssignClientAuthority(conn);
}