Finding the local player
Options
In Unet there is a variable isLocalPlayer. I have not been able to find something in TS that matches this. I also would like to know about OnStartLocalPlayer (). For right now I have written this code to get what I want:
It works and sets your player to green but seems to be a work around for what I want. I just wanted to know if there is already is a function to handle this situation. Thanks.
if (localOwner.Id == owner.Id)
{
GetComponent<MeshRenderer>().material.color = Color.green;
}
It works and sets your player to green but seems to be a work around for what I want. I just wanted to know if there is already is a function to handle this situation. Thanks.
1
Comments
-
Hi @Kobaltic,
We don't have a special function for that, it is like you did above but it is a good idea to be added in next releases, thanks!2 -
OK sounds good. Thanks @JeffersonHenrique .0