Hey all, I got a simple scenario with two players (Host and Client) and some scene objects. Lets say I call AssignClientAuthority for every scene object passing over the LocalConnectionToClient of the Host so it has control/authority over these objects.
I had a look at the variable isOwned - which does not help as it's only set on player objects.
I looked at the variable "authority" but it utilizes sync direction which I never change and I can't find it relevant for me, I only want to know the connection that has control.
I wrote this simple helper method, but not seeing it already on the framework makes me think there might be a reason for it. Is there any?
/// <summary>
/// If the current client has control over this object.
/// </summary>
/// <returns></returns>
public bool HasControlOfId()
{
return netIdentity.connectionToClient == connectionToClient;
}
Based on the method "SetClientOwner" the variable connectionToClient would only be equal to the local client connection if it owned the object. Thanks in advance!