Easy: Instantiate a Prefab in Unity when Pressing a Key and Destroy the Prefab after a Few Seconds.
HOW TO INSTANTIATE and DESTROY PREFAB CLONE in C#?
What we Need to Do:
Create C# Script
Create empty game object for our script
Create public GameObject
Create GameObject Clone for our Prefab
Instantiate prefab clone
Destroy prefab clone
Test to see if the script works
Add Shoot Button/Key
Destroy our Clone, so it doesn’t sit around and waste resources
Have fun, keep learning and Enjoy.
Any questions feel free to ask.
Unity3D Indie Game Dev Podcast: