#Help player!

8 messages · Page 1 of 1 (latest)

earnest escarp
#

Is it possible with Mirror to have two different types of clients, i.e. an active player and a spectator?

void totem
earnest escarp
#

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?

void totem
earnest escarp
#

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?

warm garnet
#

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);

void totem
earnest escarp
#

Thanks for the reply. So is this irrelevant?

csharp

NetworkServer.AddPlayerForConnection(conn, playerObject);

NetworkIdentity networkIdentity = playerObject.GetComponent<NetworkIdentity>();

if (networkIdentity != null)
{
networkIdentity.AssignClientAuthority(conn);
}