i need to change collider type but i need to be absolutly sure that none of the other functions will perform
because they are dependent on collider, i have a warning that collider is destroyed or already have meshcollider (i am changing box to mesh type) here is the function i use:
function ReplaceBoxWithMeshCollider(object : GameObject){
if(object.GetComponent(Collider).GetType()==BoxCollider){
Destroy(object.GetComponent(Collider));
object.AddComponent("MeshCollider");
object.layer=0;
}
yield WaitForEndOfFrame();
}
is there some option that waits function to be over and then to proceed?