Hi. I just learned about CustomPlanes and am using them for sprites (so that I can properly and easily make billboards) but am now having trouble destroying them. I am using these planes as I said, for sprites which are my enemies. I have a bullet script on my bullets but it does not destroy these planes. Here is the script:
using UnityEngine;
using System.Collections;
public class BulletScript : MonoBehaviour
{
float lifespan = 3.0f;
void Update ()
{
lifespan -= Time.deltaTime;
if (lifespan <= 0)
{
Explode ();
}
}
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Enemy")
{
Destroy (gameObject);
}
}
void Explode ()
{
Destroy (gameObject);
}
}
Any help would be greatly appreciated. Thanks!