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 doesn't sync Gravity/Kinematic flags reliably
Gravity and Kinematic flags on VRCObjectSync components don't sync correctly right now and also cannot be set correctly while holding the pickup. To set gravity or kinematic flags, VRChat added two new methods for us: https://udonsharp.docs.vrchat.com/vrchat-api/#vrcobjectsync (they are supposed to behave like a synced variable) There are two bugs related to this: ~ Bug 1: ~ All you need is to create a pickup that has no gravity and then toggle the gravity flag on the VRCObjectSync component with an external button after claiming ownership. Then you let different people in the world pick up the pickup and drop it (to show their own local state). In my tests, this resulted in a pickup where the gravity flag is wildly different on each client and only syncs occasionally or not at all. They would see the pickup drop on my end, but when they pick it up it has no gravity for them. ~ Bug 2: ~ All you need is to create a pickup that has no gravity and then toggle the gravity flag on the VRCObjectSync component in OnPickupUseDown() . In my tests, this resulted in a pickup where the gravity stays enabled after the first OnPickupUseDown() and I am unable to turn gravity off again. To check gravity, the pickup is dropped. You can also just test it out here: Right setup: Bug 1 / Left setup: Bug 2 https://vrchat.com/home/world/wrld_9cefd5ec-4492-43c5-8cd3-05036c494556 Additional note: Since we only got a setter and not a getter method, we are left in the dark here when it comes to analyzing the problem. Reading out the local rigidbody state doesn't give us access to the real synced state. A getter method should be added.
3
·

tracked

[2021.09.03.09.25] Disabling UdonBehaviour in Start still runs Update once
When disabling an UdonBehaviour in Start, it will still run the Update event once, even though the behaviour is disabled. This is different than MonoBehaviour's execution. Having the Update method run here could cause issues with unexpected execution and thus requires a check for if the behaviour is enabled, which is unnecessary for all other executions of the event. Please prevent Update events from being executed if the behaviour is disabled or the GameObject is inactive. Sample Graph: application/vnd.unity.graphview.elements AL1V3W7TMBh9lcrXcWXHf0ml3awbUgUCtNHeoKly7C8lkDpTfgpVtyfjgkfiFXCXtlPbAAVtU27yOc4Xn/Odc/Lz+48VWui8ATT4uEJpk+dv9dwX6HIBrp5e17qsUYCazPq1KCVchTFgpkyMOREEx5ZQHMac8oTpmOrYb74tqqzOCocGK/QNDTDlsk8CtFzfStUX9wFyhYXx6KLyX70JUJoXXzcVAhqS1EiFtRUR5jQyOJLMYs0sk4IaoUKNbtoOk/XBH3rcB3uHn1wNx7Zww2I+L9zI1VCm2kA1Wi8+ALsCA9kCyv50WkE9BaeTHOx0er2sapifF0UO2m3LSeHRbzk46XwdHDwyEB0ygPx+tE/DIcAValxWL98ln8HUk3ZeK5S5qtbOwOgCDYjvWdVl5mabxwitSfn311rM/Q0HQW9emaLMsyToTaCsPKQz3ifrK+gNm7xuSjhz0NSlzoPe+ybJM/Malh+KL+DOEqW0MELSmHEgUXz3SucVoPvDcbVaG99aXcOOaKZIKgXRmDNFMU9SijW3AlsVpalkhtpYdhEtwg3VIfuL1GJlqBKE4zCkCnO9niI1DDMirCJCWnhiqc1+K7Udap0SYwkTOATl5UXSBMcCEix1oogSykSWdqBmTG1Qd+rrOcR1SMR43ePSzTIHF5A0M4/3TTHb4mybdzrqpDEcQX5EHB7htdTEgkmLmQwt5kZKL50owoKzNIllFCZG35EXYaXFe/2wyzMyLJzROxra5f1ir9pxdAqiY454vBUF6QydKPUmIwSwDBNvMR55i5FQ49TE3rMk4QRSz1PwTAG1SZoW6tMGTZslg97ahefwSS+yoil7WdW7bO036P1nOr70a9162qSGF9SH4o+6OWXCXSEq2VY5gh4p55SMehZ7vciv6eb+Fw==
0
null-check on gameObject will throw exception if the gameObj is Destroyed
We cannot check whether a GameObject is destroyed or not. To detect an GameObject is destroyed or not, we normally may use (gameObj != null) or (gameObj != null && gameObj.name != "ToDestroy" ) or ReferenceEquals(gameObj , null) Those codes work perfectly in udonSDK3 unity editor environment. However, the same code will throw exception in-game which cause the script stop running. To investigate, we tried to enable UdonSecureHeap in editor and the editor also throw errors, so we guess that Udon's secure heap is what breaking the in-game behavior. The exception message say 'Your script should either check if it is null or you should not destroy the object.' However what I am doing is actually the null-checking!! The following is the error log. I am destroying a 'Cube' and check the cube's status using 'Tester' by showing the result on UnityEngine.UI.Text, which shows "Object is NOT null" or "Object is null" : [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 'UnityEngineObject.__op_Equality__UnityEngineObject_UnityEngineObject__SystemBoolean'. Parameter Addresses: 0x0000000B, 0x00000004, 0x0000000A The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. ---------------------- Program Counter was at: 92 ---------------------- Stack Dump: ---------------------- Heap Dump: 0x00000000: 6459115532197657758 0x00000001: Tester 0x00000002: null 0x00000003: Text (UnityEngine.UI.Text) 0x00000004: null 0x00000005: null 0x00000006: Object is null 0x00000007: Object is NOT null [ 0x00000008: ] 0x00000009: 4294967295 0x0000000A: False 0x0000000B: null 0x0000000C: 241 0x0000000D: Cube (UnityEngine.GameObject) 0x0000000E: Object is NOT null [Cube (UnityEngine.GameObject) 0x0000000F: Object is NOT null [Cube (UnityEngine.GameObject) 0x00000010: Object is NOT null [Cube (UnityEngine.GameObject)] 0x00000011: Object is NOT null [Cube (UnityEngine.GameObject)] 0x00000012: 241 0x00000013: Object is NOT null [Cube (UnityEngine.GameObject)]241 0x00000014: 4294967295 0x00000015: UnityEngineObject.__op_Equality__UnityEngineObject_UnityEngineObject__SystemBoolean 0x00000016: UnityEngineTime.__get_frameCount__SystemInt32 0x00000017: SystemInt32.__ToString__SystemString 0x00000018: SystemString.__op_Addition__SystemString_SystemString__SystemString 0x00000019: UnityEngineUIText.__set_text__SystemString__SystemVoid 0x0000001A: UnityEngineGameObject.__ToString__SystemString ---------------------- Inner Exception: ---> VRC.Udon.VM.UdonVMException: An exception occurred during EXTERN to 'UnityEngineObject.__op_Equality__UnityEngineObject_UnityEngineObject__SystemBoolean'. Parameter Addresses: 0x0000000B, 0x00000004, 0x0000000A ---> UnityEngine.MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. at (wrapper managed-to-native) UnityEngine.GameObject.get_transform(UnityEngine.GameObject) at VRC.Udon.Security .UnityEngineObjectSecurityBlacklist.IsBlacklisted[T] (T objectToCheck) [0x0008c] in C:\VRChatGit\VRChat-Udon\UdonVM\Udon\Security\Source\UnityEngineObjectSecurityBlacklist.cs:50 at VRC.Udon.ClientBindings.UdonClientInterface.IsBlacklisted[T] (T objectToCheck) [0x00000] in C:\VRChatGit\VRChat-Udon\UdonVM\Udon\ClientBindings\Source\UdonClientInterface.cs:83 at VRC.Udon.UdonManager.IsBlacklisted[T] (T objectToCheck) [0x00001] in E:\Unity Project 2018\Test2018World\Assets\Udon\UdonManager.cs:137 at VRC.Udon.Security .UdonSecureHeap.ScanHeapValue[T] (T& heapValue) [0x0005f] in C:\VRChatGit\VRChat-Udon\UdonVM\Udon\Security\Source\UdonSecureHeap.cs:142 at VRC.Udon.Security .UdonSecureHeap.GetHeapVariable[T] (System.UInt32 address) [0x0000d] in C:\VRChatGit\VRChat-Udon\UdonVM\Udon\Security\Source\UdonSecureHeap.cs:55 at VRC.Udon.Wrapper.Modules.ExternUnityEngineObject.__op_Equality__UnityEngineObject_UnityEngineObject__SystemBoolean (VRC.Udon.Common.Interfaces.IUdonHeap heap, System.UInt32[] parameterAddresses) [0x00000] in C:\VRChatGit\VRChat-Udon\UdonVM\Udon\Wrapper\Source\Modules\UnityEngine\ExternUnityEngineObject.cs:89 at VRC.Udon.VM.UdonVM.Interpret () [0x00272] in C:\VRChatGit\VRChat-Udon\UdonVM\Udon\VM\Source\UdonVM.cs:281 --- End of inner exception stack trace --- at VRC.Udon.VM.UdonVM.Interpret () [0x00326] in C:\VRChatGit\VRChat-Udon\UdonVM\Udon\VM\Source\UdonVM.cs:305 --- End of inner exception stack trace --- at VRC.Udon.VM.UdonVM.Interpret () [0x003f4] in C:\VRChatGit\VRChat-Udon\UdonVM\Udon\VM\Source\UdonVM.cs:346 at VRC.Udon.UdonBehaviour.RunProgram (System.UInt32 entryPoint) [0x0006a] in E:\Unity Project 2018\Test2018World\Assets\Udon\UdonBehaviour.cs:1867 UnityEngine.Debug:LogError(Object, Object) VRC.Core.Logger:LogError(String, Int32, Object) VRC.Udon.UdonBehaviour:RunProgram(UInt32) (at Assets/Udon/UdonBehaviour.cs:1877) VRC.Udon.UdonBehaviour:Update() (at Assets/Udon/UdonBehaviour.cs:762)
7
·

interested

Load More