- Home /
Question by
Charles_Gams · Mar 29, 2013 at 11:17 AM ·
buttondestroyclone
Destroy instantiated clone after input.getbutton has been released
I'm having trouble figuring this out i want to destroy the instantiated clone after I've stopped holding down a button. So i can improve performance and not have empty clones laying around in the scene/game
Comment
Answer by psycocrusher · Mar 30, 2013 at 12:41 AM
Why don't you have a script on the clones?
function Start () {
//Destroy after 3 secs.
Destroy(gameObject,3);
}
I've tried this approach but they don't get destroyed
Your answer
![](https://koobas.hobune.stream/wayback/20220613095318im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
instantiate and destroy object with the same button 1 Answer
Respawn question unanswered 0 Answers
Destroy Child of Game Object 2 Answers
Destroying assets is not permitted to avoid data loss? 0 Answers
Remove an element from an array 2 Answers