Hi, i’m currently making an augmented reality application and want to resize a box collider, but the application just dies when trying to do this.
foreach (Renderer component in rendererComponents) {
component.enabled = true;
component.transform.gameObject.AddComponent<BoxCollider>();
BoxCollider bc = component.transform.GetComponent<BoxCollider>();
bc.size = new Vector3(0.2f, 0.4f, 0.2f);
component.transform.gameObject.AddComponent<RotateObject>();
}
I tried to just get one of the components of the box collider size just to see if i could at least get its value:
float bX = bc.bounds.size.x;
But even with just this like the application dies.
Thanks in advance.