Bounds.Expand() and other methods that modify the struct it is called on do not work.
tracked
|KitKat|
Repro:
var bounds = new Bounds(Vector3.zero, Vector3.one);
Debug.Log("Bounds: " + bounds.size);
bounds.Expand(100f);
Debug.Log("Bounds: " + bounds.size);
Log In
StormRel
Merged in a post:
Bounds.Encapsulate() does not work
genail
VRChat Version:
SDK Base 3.1.10
Worls: 3.1.10
Package Resolver: 0.1.17
Client Simulator: 1.2.2
UdonSharp: 1.1.6
Description of the bug:
Bounds.Encapsulate() does not work at all. The bounds object is not being updated, no matter the input. Doing the same in a regular Unity C# project works flawlessly.
Steps to reproduce (how did you encounter the bug?):
- Bounds bounds = new Bounds();
- bounds.Encapsulate(new Vector3(10, 10, 10));
- Debug.Log(bounds);
- It prints Center: (0.0, 0.0, 0.0), Extents: (0.0, 0.0, 0.0)
- With a regular C# project, the same code produces: Center: (5.0, 5.0, 5.0), Extents: (5.0, 5.0, 5.0)
This post was marked as
tracked
aurycat
Confirmed this is still an issue in SDK 3.7.6
アディン・ヨハネ
VRChat World SDK 3.6.0 not work.
アディン・ヨハネ
I just checked.
Bounds.Encapsulate() does not work with VRChat World 3.5.2 standard.
yoshio_will
Alternative plan: it worked
private Bounds BoundsEncapsulate(Bounds a, Bounds b)
{
Bounds result = new Bounds();
result.min = Vector3.Min(a.min, b.min);
result.max = Vector3.Max(a.max, b.max);
return result;
}
Reimajo
I can confirm that. It seems to be a general issue: