Good evening!
I am new at unity.
I have a bullet prefab which spawns and shoots when i press spacebar.
all clones have name bullet(clone).
How do i self-destroy bullet after 15 seconds?
Destroy(???,15);
Thanks in advance.
From a script on the bullet itself:
Destroy(gameObject, 15);
Or from your spacebar-press script:
var bulletInstance = Instantiate(BulletPrefab);
Destroy(bulletInstance, 15);
Thanks!