Looking to destroy a platform once the user/character has been stood on it for x amount of seconds!
Thanks!
Looking to destroy a platform once the user/character has been stood on it for x amount of seconds!
Thanks!
well its simple, you can use the
function OnCollisionEnter (hit : Collision){
if (hit.transform.name == "players name here"){
Destroy(gameObject, "delay timer here");
}
}
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.
– Key_LessSorry 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.
– nickehPerfect, then thenachotech1113's answer should be what you're looking for. I appreciate the response.
– Key_Less