I need a way to destroy a light that is spawned after i click the Fire1 key after 0.1 seconds to make a flash effect.
is there any destroy scripts that can destroy a specific object after spawning it?
I need a way to destroy a light that is spawned after i click the Fire1 key after 0.1 seconds to make a flash effect.
is there any destroy scripts that can destroy a specific object after spawning it?
You can use something like this:
public GameObject light;
void Update(){
if(Input.GetKey(KeyCode.UpArrow)){
destroy(light);
}
}
Attach a light into the script(remember to make a new prefab for this), and use this code hope work for you.