Hi all, So i have a problem with Destroyable objects in my game, i have a plane, which is a glass and when the player hits it it instantiate prefab which is glass/window thats in pieces, but the problem is that it only works in one direction, if i rotate the glass for example 90 degrees and destroy it it destroys instantiate prefab as it wasnt rotate so it looks wrong. Here is photo to understand me better
Here is the code of my destructible glass
var boxdead : boolean;
var boxdeadprefab : Transform;
function Start () {
boxdead = false;
}
function Update(){
if(health <= 0){
if(!boxdead)
{
boxdead = true;
Instantiate(ParticleOnDestroy, transform.position, Quaternion.identity);
DestroyOb();
}
}
}
function DestroyOb ()
{
Destroy(gameObject, destroy.length);
Instantiate(boxdeadprefab, transform.position,boxdeadprefab.transform.rotation);
}
Thanks for helping!
