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.
Can't render over the screen with more than 1 camera on Quest
What I'm going to describe is a very niche bug, that won't bother a lot of people, but it's been preventing me from porting some cool worlds like "Thad Recursive Room" to Quest, because it relies on some render tricks with multiple cameras. If you have a camera without a render target, it will render on screen. And if you set the "depth" parameter greater than 0, it will render after the main camera, effectivly acting like an overlay camera. So far, everything works. But doing that with more than 1 camera does not work. So if you use a second camera with an even higher depth value, it's content won't show up on the screen as long as the first overlay camera is still on (That is, if the content of the second overlay camera is actually performing a z test). But it gets stranger from here: if I open and close the menu a few times and also click on some of the menu tabs like the world menu. Every now and then it causes a glitch that will make the content of the second overlay camera sort of appear from there on out. What I can see then, is that when I move my head, it moves away an invisible shape that was blocking the content of the second overlay camera. And that shape fits perfectly the object it is supposed to render. It is as if the z values of the second overlay camera are already written to the depth buffer before the actual rendering of the second overlay camera begins and then the z test fails against its own values. But after the menu glitch, the occluding depth image seems to be frozen in place and I can partly move it out of the way by changing my view. Also: one time I tried something similar with cameras rendering before the main camera (depth parameter is set to a negative value, and main camera is set to clear nothing). Results were similar, and after I managed to get something visible with the menu glitch, it appeared as if the cameras that render earlier than the main camera were very pixelated, which was also surprising. I've been also experimenting with manually calling render() on multiple cameras that are supposed to render on screen during several render related events (for example in OnPostRender of the first overlay camera), but no luck getting their content to show in any way.
1
·
tracked
"System.ArgumentException: Type provided must be an Enum" when using user-defined enum as a default parameter value in UdonSharp
Defining a method parameter of a user-defined enum type with a default value causes the UdonSharp compiler to throw during binding. The same method compiles successfully when the default value is removed. This issue does not reproduce with Unity/SDK-defined enums (e.g., UnityEngine.HumanBodyBones , VRC_Pickup.PickupHand). Reproduction using UdonSharp; public class EnumTest : UdonSharpBehaviour { // Compile error public void TestMethod(TestEnum testEnum = TestEnum.ValueB) { } } public enum TestEnum { ValueA, ValueB, ValueC } Actual Behavior Compile fails with Assets/Main/Misc/Enum/EnumTest.cs(6,0): System.ArgumentException: Type provided must be an Enum. Parameter name: enumType at System.Enum.ToObject (System.Type enumType, System.Int32 value) at System.Enum.ToObject (System.Type enumType, System.Object value) at UdonSharp.Compiler.Symbols.ParameterSymbol..ctor (...) at UdonSharp.Compiler.Symbols.UdonSharpBehaviourTypeSymbol.CreateSymbol (...) ... (Full message attached below) The exception is thrown inside ParameterSymbol when UdonSharp tries to evaluate a parameter’s default value using Enum.ToObject(enumType, value) during compilation. For user-defined enums, this call receives an argument that is not recognized as a valid enum type for some reason, which causes System.ArgumentException: Type provided must be an Enum . Workarounds Avoid using default parameter values for enums and provide an overload as a pseudo-default instead public void TestMethod(TestEnum testEnum) { } public void TestMethod() => TestMethod(TestEnum.ValueA);
1
·
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
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
Load More