I'm using Mirror as UNet is deprecated. How can I get the local player GameObject in my code?
\$\begingroup\$
\$\endgroup\$
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;