|
I am trying to add the bounds of a collider that is added at runtime. For some reason, I am unable to see updates to center or size or extent when I set it using the below:
var p = new GameObject("box");
p.AddComponent(BoxCollider);
p.collider.bounds.center = Vector3(4.5,4.5,4.5);
.
.
.
The resulting collider shows up in the inspector, but the values are always default, i.e., center and size aren't showing up as defined. How do you set the bounds, center, and such of a collider added at runtime?
(comments are locked)
|
|
I don't think you can assign the bounds of a collider directly. However, the collider itself has center and extents properties that you can assign. As an example: it looks like not calling it collider.bounds.center etc does the trick. thanks!
Mar 13 '12 at 06:03 AM
ina2
in unity js... you actually have to call
Mar 13 '12 at 06:06 AM
ina2
(comments are locked)
|
