CyanLaser/CyanEmu

Utilities.IsValid(Networking.LocalPlayer) returns false

Guribo opened this issue · 4 comments

This is not happening in VRChat but only in the Unity editor.

It can easily be tested with a simple U# script containing e.g. the following:

        private void Update()
        {
            if (Networking.LocalPlayer != null)
            {
                Debug.Log("Local player is not null");
            }
            
            if (!Utilities.IsValid(Networking.LocalPlayer))
            {
                Debug.LogError("Local player is not valid");
            }
        }

Result in editor:
image

Result in game:
image

Tested with Cyan Emu v0.3.4 Beta and Udon Sharp v0.19.5.

Thank you for finding this. I'll look into it. Do you know of any other items that might have improper IsValid implementation?

So far I only noticed it for VRCPlayerApis, I will let you know when I find others.

Hopefully fixed in e53d01f

It is working now. Thanks!