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.
[1539] Later-Joiner's `OnVariableChanged` can be fired before `Start()` if the object owner syncs variables frequently
On Later-Joiner's client, OnVariableChanged can be fired without OnDeserialization() before OnEnable() and Start() . It will be happened especially if the object owner uses RequestSerialization() frequently (such as per second interval synchronization). It can be critical problem because it makes OnEnable() and Start() are not guaranteed before synced variable changes: firing OnVariableChanged before Start() can breaks Udons that implementing initialization at Start() . This bug seems the reoccurrence of following this Canny: https://feedback.vrchat.com/udon/p/1259-synced-variables-can-be-changed-from-owners-requestserialization-before-lat Build: 1539 ---- I've made the new testing world to check event orders: https://vrchat.com/home/world/wrld_c357c8f1-1d22-4e91-bfdc-e72c04097fe1/info . (Sample screenshot is attached below) Reproduction steps: Make the instance of the world (Player A), join the instance then enable interval sync from "Toggle Sync Interval" buton. (It starts 0.25s interval of synced int increment using manual sync) Join another player to its instance (Player B). See the console UI in the world at Player B. Expected Results: At Player B console UI, "SyncInt change" console message should only be occured before "OnEnable". Actual Results: At Player B console UI, there is small chance to occur "SyncInt change" console message before "OnEnable". - It may sometimes not be occurred, so try re-joining several times.
1
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