I’m trying to get accurate world coordinates for a certain local point of an object’s box collider (say, the bottom rear right corner when facing +z). I’ve used the following implementation in a script attached to the object:
var pos:Vector3=transform.TransformPoint( Vector3.right*collider.bounds.extents.x+ Vector3.down*collider.bounds.extents.y+ Vector3.back*collider.bounds.extents.z);
This places it pretty close to where I’d expect, when the object is facing forward; however, when I turn it to the side in the game (rotate it left by the Y axis), the point that this returns bows outward, a good 20% or so outside the collider, making the particles I’m spewing from it leave widening and narrowing trails. Do you know what’s going on, and how to keep it more consistently accurate no matter the transform’s orientation?