I create small halos on click, and I would like to destroy them after some time but somehow I can only destroy the object that I Instantiate - Light
and this GameObject
that I create also has animation
, halo
; etc.
How can I destroy the GameObject
having the light component.
Code :
public Light haloLight;
Object newHalo = Instantiate (haloLight, hit.point, transform.rotation);
Destroy (newHalo, 1.5f);
With this I can only destroy the Light
component
I have also tried
GameObject newHalo = Instantiate (haloLight, hit.point, transform.rotation) as GameObject;
Destroy (newHalo, 1.5f);