- Home /
Question by
annonymushubh · Jul 21, 2017 at 12:13 PM ·
unity 5destroy
i have some people walk around the scene but it will destroy after going away from the scene
i have the Some people to walk around in the scene but they have to destroy after going away from the scene plz help and fast
Comment
Answer by NorthStar79 · Jul 21, 2017 at 12:16 PM
if(Vector3.Distance(gameObject.transform.position, Vector3.zero) > 100) Destroy(gameObject);
Your answer
Follow this Question
Related Questions
using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers
How can I remove an object when colliding with an other object? 1 Answer
Destroy script and component it depends on 2 Answers
i have problem with animation play via script 3 Answers
*URGENT* Really Basic Script Problem 1 Answer