Red
Red

Reputation: 33

How to clone destroyed objects in unity3D?

I made a wall that get destroyed when the character touches it and then he can keep walking. I want to create the same wall after few seconds or after the character pass it , anyone knows how do it ? ( I already tried it with a timer and OnCollisionExit but it didn't seem to work)

Upvotes: 1

Views: 408

Answers (1)

Adam R. Grey
Adam R. Grey

Reputation: 2024

  1. store a reference to your object (probably in your player script)
  2. Set it to inactive with GameObject.SetActive(false) when you're
  3. ready (your OnCollisionExit or timer function), set it to active.

Upvotes: 1

Related Questions