Skip to main content

The ClientScene class has a static property called localPlayer of type NetworkIdentity. All Components in Unity have gameObject as property which refers to the GameObject they're attached to. So in order to get the localPlayer object you would do:

using Mirror;
GameObject localPlayer = ClientScene.localPlayer.gameObject;

New Method 2021:

using Mirror;
GameObject localPlayer = NetworkClient.localPlayer.gameObject;

The new method uses the NetworkClient from Mirror

Banana
  • 243
  • 2
  • 10