- Home /
Destroy object on collision with button
Hello I am new to unity and I have a problem. I have spawning people who are going straight and on their way there is a small quad and my problem is that I don't know how to delete them when they are standing on that quad. What is more I want to delete them via button so when they are standing on that quad, user simply press button and the game object is being destroyed. Thank you for response in advance.
Answer by tormentoarmagedoom · Mar 12, 2018 at 03:53 PM
Good day.
You are asking very basic questions. You should look for the answer by your own with tutorials and the UNITY API. For this time, i will give you some links of what you need.
You need to add to your person a COLLIDER component, and a RIGIDBODY component. Add a COLLIDER to the quad zone
Then via scrpit use OnCollisionStay to know if the person is in the space you want. If there is, use the DESTROY
Read them, look for video-tutorials in youtube, and you will learn by your own.
If helped, accept the answer :D