- Home /
NetworkBehaviour has an "isLocalPlayer" boolean, but is there a sort of "localPlayer" G.O. reference?
I have all my player-specific functions working on my player prefab. There are built/instantiated objects though, during runtime, which ultimately need to reference variables or components which I know are specifically inside the player's prefab.
Before I started trying to implement multiplayer, I was using functions like "GameObject.Find" to reference what I knew would be the only player.
Functions like OnServerStart and OnStartLocalPlayer, etc, are very helpful, but even with nullchecks and returns, given that I need certain things to be set (for example to determine the active state of a collider which i need to raycast on, based on a variable on the local player, but this colliders object is not parented to the player, or necessarily created through the player.
What's the usual order of operations for that kind of requirement?