- Home /
Question by
areFranz · May 07, 2014 at 02:04 PM ·
collisionasset storeoncollisionenterexplosion
Why the "Detonator Explosion Framework" from AssetStore don't render in compiled game?
Hi All! I have imported the free "Detonator Explosion Framework" from the AssetStore and i applied it to a prefab that is instantiate before object deletion. In the game mode in unity it's all right! Wonderfull explosions! But when i build the project, there are no explosions, only object deletion. The game is a space shooter where a wing shoots asteroids.
using UnityEngine;
using System.Collections;
public class WeaponCollision : MonoBehaviour {
public Transform explosion;
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Asteroids")
{
if (GameManager.Instance.GetWeapon () == "Laser")
collision.gameObject.GetComponent<AsteroidsRotation>().SendMessage ("ApplyDamage", 1);
if (GameManager.Instance.GetWeapon () == "Plasma")
collision.gameObject.GetComponent<AsteroidsRotation>().SendMessage ("ApplyDamage", 4);
if (collision.gameObject.GetComponent<AsteroidsRotation>().damage == 0) {
Transform asteroidExplosion = Instantiate (explosion, collision.gameObject.transform.position, collision.gameObject.transform.rotation) as Transform;
Camera.main.GetComponent<InGameGui>().SendMessage ("IncrementPoints");
Destroy (collision.gameObject);
}
Destroy (this.gameObject);
}
}
}
This is the script attached to the projectiles of the wing. Can someone help me?
Comment