Hello everyone,
I have a cube that when it gets hit by another object it disappears and the particles effects show up. It’s working fine now, but I don’t like that the particles appear automatically at the beginning of the game, so I unchecked the “Play on awake” box in the Inspector, and now the particles don’t show neither in the beginning nor when the cube gets destroyed. If I check the “Play on awake” again they show at the beginning and when the cube gets destroyed, how can I make them appear just when the cube gets destroyed?
This is my code for the box
using UnityEngine;
using System.Collections;
public class BoxDestruction : MonoBehaviour {
public GameObject BoxParticle;
void OnCollisionEnter ()
{
Instantiate (BoxParticle, transform.position, Quaternion.identity);
Destroy(gameObject);
}
}
Thanks in advance,