I've found an issue with the
Bounds.SetMinMax
method in Udon. When using this method, it's expected that the Bounds object it's called on sets its min and max bounds to the supplied
Vector3
values respectively. In testing, its values instead seem to stay completely unchanged.
This issue does not appear when using the
Bounds.min
and
Bounds.max
setters directly.
Below is a code snippet demonstrating the issue, along with the expected and actual log outputs. An UdonGraph screenshot is also included for completeness.
Version info:
  • Unity 2022.3.22f1
  • VRChat SDK - Base 3.10.3
  • VRChat SDK - Worlds 3.10.3
BoundsSetMinMax.cs:
void Start()
{
var boundsTest = new Bounds(new Vector3(1, 2, 3), new Vector3(4, 5, 6));
Debug.Log($"New - {boundsTest}");
boundsTest.SetMinMax(new Vector3(1, 2, 3), new Vector3(4, 5, 6));
Debug.Log($"SetMinMax - {boundsTest}");
boundsTest.min = new Vector3(1, 2, 3);
boundsTest.max = new Vector3(4, 5, 6);
Debug.Log($"min, max - {boundsTest}");
}
Output when executed as C#:
New - Center: (1.00, 2.00, 3.00), Extents: (2.00, 2.50, 3.00)
SetMinMax - Center: (2.50, 3.50, 4.50), Extents: (1.50, 1.50, 1.50)
min, max - Center: (2.50, 3.50, 4.50), Extents: (1.50, 1.50, 1.50)
Output when executed as U#:
New - Center: (1.00, 2.00, 3.00), Extents: (2.00, 2.50, 3.00)
SetMinMax - Center: (1.00, 2.00, 3.00), Extents: (2.00, 2.50, 3.00)
min, max - Center: (2.50, 3.50, 4.50), Extents: (1.50, 1.50, 1.50)
UdonGraph example:

Photo Viewer

View photos in a modal