Hey all,
I have a boxcollider with the extents set to that of the meshfilter.
collider = (BoxCollider)gameObject.GetComponent(typeof(BoxCollider));
SkinnedMeshRenderer mr = GetComponentInChildren(typeof(SkinnedMeshRenderer)) as SkinnedMeshRenderer;
if (mr != null)
{
collider.extents = mr.bounds.extents;
}
When the gameObject rotates, the box scales up to keep the object inside, but I don’t want this. I want the boxcollider to have the initial mesh fit and then have it never rescale when the mesh changes it’s transform.
Does anyone know how to do this?