How do I check if my VRCPlayerAPI Variable is a reference of an object?

I’ve attempted checking if a VRCPlayerAPI equals Null but I continue to get “Object reference not set to an instance of an object”, it’s incredibly annoying not knowing how or if you can check this.
image

I’ve tried “isValid” I’m getting an error when I compile

AssemblyException: Data variable ‘Boolean_3’ already exists. Line: 48

I’m guessing isValid is attempting to create another Boolean_3 by mistake?

So it seems isValid is kinda broken atm, and the easiest fix is to just do it earlier in the flow of your code, like store it if you need to check it later in your flow. I was doing it directly before it became relevant to check in my code. I moved it closer to the start of my event, stored it in a boolean variable and the error ceased.

I’m fairly certain you’re trying to compare two different data types.

an object and an instance…

Then again I use u# for this stuff so it might be able to type juggle.

yea I was, but I did figure this out eventually, it seems the PlayerAPI isValid function may be broken at the moment? Or maybe the error I’m getting is a CyanEmu thing.

1 Like