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.
Issue on implementing custom DSP algorithms with OnAudioFilterRead
I have encountered a problem related to Unity's DSP chain and Udon. I am planning to create an audio focused world, where I need to implement a custom DSP algorithm on audio that can respond to player behavior/controls in real-time. In the native Unity Mono framework, I can insert custom effects into the audio DSP chain by implementing the OnAudioFilterRead method in MonoBehaviour (see https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnAudioFilterRead.html ). In the UdonSharp documentation, I found that there is a method stub for OnAudioFilterRead in Unity events (see https://udonsharp.docs.vrchat.com/events/ ), so I should be able to implement it. However, it does not work in my Unity setup. I also saw a post on Canny mentioning that a component called OnAudioFilterReadProxy should be automatically added to the object if OnAudioFilterRead is implemented (See: https://vrchat.canny.io/udon/p/order-of-onaudiofilterreadproxy ), but this is not happening on my end. Any idea what could be going wrong with my script or configuration? Or it is a bug? My test code is like the following: using UdonSharp; using UnityEngine; using VRC.SDKBase; using VRC.Udon; public class SimpleSineGenerator : UdonSharpBehaviour { [SerializeField, Range(0, 1)] private float amplitude = 0.5f; [SerializeField] private float frequency = 261.62f; private double phase = 0; private double sampleRate = 48000; public void Update() { // verify that the script is running transform.Rotate(Vector3.up, 90f * Time.deltaTime); } public void OnAudioFilterRead(float[] data, int channels) { // DSP code double phaseIncrement = 2 * Mathf.PI * frequency / sampleRate; for (int i = 0; i < data.Length; i += channels) { phase += phaseIncrement; if (phase > 2 * Mathf.PI) { phase -= 2 * Mathf.PI; } float value = amplitude * Mathf.Sin((float)phase); for (int j = 0; j < channels; j++) { data[i + j] = value; } } } }
2
·
Bug Reports
·
tracked
[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
·
Bug Reports
Vector "Scale" Has No Effect
The Scale method on Vector classes is intended to scale each component of a vector by the respective component of another vector, and apply the result to the vector whose method was called. This method does not seem to be functioning in Udon. This issue affects all Vector types. Below is a code snippet demonstrating the issue, along with the expected and actual log outputs. Version info: Unity 2022.3.22f1 VRChat SDK - Base 3.10.3 VRChat SDK - Worlds 3.10.3 Vector3Scale.cs: void Start() { var v2ScaleTest = new Vector2(1, 2); v2ScaleTest.Scale(new Vector2(10, 20)); Debug.Log($"Vector2(1, 2, 3).Scale(10, 20, 30) = {v2ScaleTest}"); var v2IntScaleTest = new Vector2Int(1, 2); v2IntScaleTest.Scale(new Vector2Int(10, 20)); Debug.Log($"Vector2Int(1, 2, 3).Scale(10, 20, 30) = {v2IntScaleTest}"); var v3ScaleTest = new Vector3(1, 2, 3); v3ScaleTest.Scale(new Vector3(10, 20, 30)); Debug.Log($"Vector3(1, 2, 3).Scale(10, 20, 30) = {v3ScaleTest}"); var v3IntScaleTest = new Vector3Int(1, 2, 3); v3IntScaleTest.Scale(new Vector3Int(10, 20, 30)); Debug.Log($"Vector3Int(1, 2, 3).Scale(10, 20, 30) = {v3IntScaleTest}"); var v4ScaleTest = new Vector4(1, 2, 3, 4); v4ScaleTest.Scale(new Vector4(10, 20, 30, 40)); Debug.Log($"Vector4(1, 2, 3, 4).Scale(10, 20, 30, 40) = {v4ScaleTest}"); } Output when executed as C#: Vector2(1, 2, 3).Scale(10, 20, 30) = (10.00, 40.00) Vector2Int(1, 2, 3).Scale(10, 20, 30) = (10, 40) Vector3(1, 2, 3).Scale(10, 20, 30) = (10.00, 40.00, 90.00) Vector3Int(1, 2, 3).Scale(10, 20, 30) = (10, 40, 90) Vector4(1, 2, 3, 4).Scale(10, 20, 30, 40) = (10.00, 40.00, 90.00, 160.00) Output when executed as U#: Vector2(1, 2, 3).Scale(10, 20, 30) = (1.00, 2.00) Vector2Int(1, 2, 3).Scale(10, 20, 30) = (1, 2) Vector3(1, 2, 3).Scale(10, 20, 30) = (1.00, 2.00, 3.00) Vector3Int(1, 2, 3).Scale(10, 20, 30) = (1, 2, 3) Vector3Int(1, 2, 3).Scale(10, 20, 30) = (1, 2, 3) Vector4(1, 2, 3, 4).Scale(10, 20, 30, 40) = (1.00, 2.00, 3.00, 4.00)
1
·
Bug Reports
·
tracked
Load More