How to find the correct Networking.NetworkConnection

I am struggling to fully understand UNET, pretty new to Unity.

I am trying to work with NetworkIdentity.AssignClientAuthority to assigns control of an object to a client via the client’s NetworkConnection. Here i need to assign “The connection of the client to assign authority to” (Networking.NetworkConnection) and i just do not understand how to identifying the connection for the player i want to assign to.

I guess i want to assign to the active player but how do i do that?

Really appreciate any help possible :slight_smile:

What do you mean by active player? In a multiplayer game aren’t there multiple active players?
Can you tell me what you are doing in your game and why you want to assign authority to a certain connection?
NetworkServer.connections contains a list of all the connections, though you only have access to this if you are the server/host.
If you want YOUR connection, I think you can use NetworkClient.connection.
I have never used NetworkIdentify.AssignClientAuthority, I don’t know if it sends something to the server and waits for a response or something.

teremy, i am a bit confused as you can see :slight_smile:

I am testing UNET using a bit of code were i have a GameObject that i want to change authority on.

  1. Player 1 owns the GameObject
  2. Player 1 drags and drop the GameObject
  3. Player 2 clicks on the GameObject and get ownership
  4. Player 2 drag and drop

This is a bit as a card game were one player do something with a card and then the next player do something with the same card.