World/Udon Bugs & Feature Requests

Post about current World or Udon bugs feature requests. One item per post!
Non-constructive and off-topic posts will be moved or deleted.
VRCObjectSync Respawn does not work
I tried this both with udon graph and udon sharp. Both times, when calling the Respawn function, the udon script throws an error and halts. It says that the reference is not set to an instance of an object, even though every time, I check, and there is an object with a VRCObjectSync attached to it that Respawn() is called from. And Respawn() is called from the VRCObjectSync, and not the GameObject. This is the error I get from udon graph: [UdonBehaviour] An exception occurred during Udon execution, this UdonBehaviour will be halted. VRC.Udon.VM.UdonVMException: The VM encountered an error! Exception Message: An exception occurred during EXTERN to 'VRCSDK3ComponentsVRCObjectSync.__Respawn__SystemVoid'. Parameter Addresses: 0x00000000 Object reference not set to an instance of an object ---------------------- Program Counter was at: 28 ---------------------- Stack Dump: ---------------------- Heap Dump: 0x00000000: Microphone (VRC.SDK3.Components.VRCObjectSync) 0x00000001: Microphone (VRC.SDK3.Components.VRCObjectSync) 0x00000002: VRCSDK3ComponentsVRCObjectSync.__Respawn__SystemVoid ---------------------- Inner Exception: ---> VRC.Udon.VM.UdonVMException: An exception occurred during EXTERN to 'VRCSDK3ComponentsVRCObjectSync.__Respawn__SystemVoid'. Parameter Addresses: 0x00000000 ---> System.NullReferenceException: Object reference not set to an instance of an object at VRC.SDK3.ClientSim.ClientSimObjectSyncHelper.RespawnObject (VRC.SDK3.Components.VRCObjectSync sync) [0x00000] in .\Packages\com.vrchat.worlds\Integrations\ClientSim\Runtime\Helpers\ClientSimObjectSyncHelper.cs:18 at VRC.SDK3.Components.VRCObjectSync.Respawn () [0x00009] in <6ff4ff48394b436282bb70dc0ff277c2>:0 at VRC.Udon.Wrapper.Modules.ExternVRCSDK3ComponentsVRCObjectSync.__Respawn__SystemVoid (VRC.Udon.Common.Interfaces.IUdonHeap heap, System.Span`1[T] parameterAddresses) [0x0001d] in <b001fa9908f1453c979dae8b67f4c4f7>:0 at VRC.Udon.VM.UdonVM.Interpret () [0x00273] in <62e4a0d35446446b8fa1f8e5755bcfaa>:0 --- End of inner exception stack trace --- at VRC.Udon.VM.UdonVM.Interpret () [0x0033c] in <62e4a0d35446446b8fa1f8e5755bcfaa>:0 --- End of inner exception stack trace --- at VRC.Udon.VM.UdonVM.Interpret () [0x00436] in <62e4a0d35446446b8fa1f8e5755bcfaa>:0 at VRC.Udon.UdonBehaviour.RunProgram (System.UInt32 entryPoint) [0x00063] in .\Packages\com.vrchat.worlds\Runtime\Udon\UdonBehaviour.cs:1098 UnityEngine.Debug:LogError (object,UnityEngine.Object) VRC.Core.Logger:LogError (string,string,UnityEngine.Object) VRC.Udon.UdonBehaviour:RunProgram (uint) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1112) VRC.Udon.UdonBehaviour:RunEvent (string) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1306) VRC.Udon.UdonBehaviour:ManagedUpdate () (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:551) VRC.Udon.UdonManager:Update () (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonManager.cs:354)
3
·

tracked

Checking a system-defined enum with equality operators fails
Checking the equality/inequality of a system-defined enum with equality/inequality operators ( == / != ) will fail. As a result, this example codes in the document don't work as expected: https://creators.vrchat.com/platforms/android/android-best-practices/#2-detect-mobile-players-in-your-world-automatically public override void OnInputMethodChanged(VRCInputMethod inputMethod) { if (inputMethod == VRCInputMethod.Touch) { // Run code for touch input } else { // Run code for non-touch input } } (The UdonGraph version (attached image) also has an identical issue.) Workaround Cast to underlying values and compare them. if ((int)inputMethod == (int)VRCInputMethod.Touch) Analysis UdonSharp compiles the expression inputMethod == VRCInputMethod.Touch into EXTERN, "SystemObject.__Equals__SystemObject__SystemBoolean" Although Object.Equals(Object) is overridden by Enum.Equals(Object) , which the inputMethod may have, with comparing underlying value, this EXTERN seems to call the Object.Equals directly (maybe via reflection API), and it returns the unexpected result (by only comparing the referencing instances). The EXTERN, "SystemObject.__Equals__ comes from here https://github.com/vrchat-community/UdonSharp/blob/22307065bd408dfd163fe46b0b8b701a4efcbc00/Packages/com.vrchat.UdonSharp/Editor/Compiler/Binder/BoundNodes/BoundInvocationExpression.cs#L420 And replacing the System_Object of this line with System_Enum doesn't work because the Enum.Equals is not exposed. Suggestions Temporary, rewrite the example codes using cast operator Expose System.Enum.Equals And replace the EXTERN with System.Enum.Equals
4
·

tracked

Load More