- Home /
Destory object after a delay once there is collision
Looking to destroy a platform once the user/character has been stood on it for x amount of seconds!
Thanks!
Could you give a little more detail on the behavior of the platform? Do you want the platform to be destroyed even if the player moves off of it before the delay time expires? Will the platform come back after it is destroyed? @thenachotech1113's solution will work perfectly fine. But you may want to consider other options based on the behavior of the platform.
Sorry for the very simple question. Basically I want the player to hit the platform and from there be a 5 second delay before the platform is destroyed, even if the player moves of the object.
Perfect, then thenachotech1113's answer should be what you're looking for. I appreciate the response.
Answer by thenachotech1113 · Nov 21, 2013 at 07:50 PM
well its simple, you can use the
function OnCollisionEnter (hit : Collision){
if (hit.transform.name == "players name here"){
Destroy(gameObject, "delay timer here");
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613122431im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make a sound play and have a delay after so it can't be activated again very fast? 1 Answer
Player collision activates GO 0 Answers
Plinko Collision Problem 2 Answers
Delay Jumping 3 Answers