Unity 2020.2.7 on Windows:
This image contains the server in editor, client in build. Client have spawned 2 units and deselected them.
I log who creates units. I have the sprite renderer on the selectionCircle on the unit off by default (as it should be).
I have also added logging when enabling/Disabling SpriteRenderer by adding a log script that I also call in the UnityEvents:
I also only call “onSelected” from client Select method (as shown in course):
[Client]
public void Select()
{
if(!hasAuthority) {return;}
onSelected?.Invoke();
Debug.Log("Client Select by: " + connectionToClient.connectionId);
}
As seen in the first image, unit is spawned by server, the sprite renderer is turned on, but I don’t know why…
Anyone else had issues with SpriteRenderer being on on server for all non-server units?
Any idea on how to track this bug down?
Throw away the UnityEvents and handle the SpriteRenderer by code instead of inspector clicking?