VRCObjectSync functions are causing null reference errors in editor and client sim
tracked
ville672
I updated to the recent 3.7.2-persistence-beta.1 SDK and this line of code returns null when it used to work fine. Object reference is not null and the object has a VRC Object Sync component.
MyGun.GetComponent<VRCObjectSync>().FlagDiscontinuity();
Edit: I cannot reproduce the issue in a clean project, even after an SDK upgrade. For some reason in the broken project null check on GetComponent<VRCObjectSync>() says it exists but when trying to call a function on it it returns null.
Edit 2: This is only happening in editor and client sim. Works in Build and test and when uploaded.
Log In
StormRel
tracked
ʙɪɢ․
StormRel This issue still occurs exactly as described on version 3.7.5 of the SDK and I believe I've found the cause.
To recap: attempting to do
gameObject.GetComponent<VRCObjectSync>().FlagDiscontinuity();
does not return null in Debug.Log, yet produces an object reference error in client sim. This same bug occurs when using VRCObjectSync.TeleportTo
.I'm not sure if this is also the case for OP, but in my project I've narrowed down that this bug only occurs when attempting to do the above to an object also being handled by a VRCObjectPool. This seems especially likely considering OP reported this during a persistence beta, where the VRCObjectPool was first being introduced.
I hope that helps!
ville672
ʙɪɢ․ I have multiple of these referenced in custom player object scripts but none of them are a part of a VRCObjectPool. Still happening in SDK 3.7.6