So recently I’ve been working on a game where you jump over obstacles kind of like a subway surfers. I added a button that pops up after you die and it asks you to spend coins to be revived when you hit an object such as a chair. The button does work as when you spend coins you re spawn back to where you were and I tried making an invincibility type thing for a certain amount of time such as 2 seconds so the player doesn’t collide with anything. The whole re spawning back to its position works but the invincibility isn’t working as the player is still colliding with objects, I’ve been trying to figure out how to fix it.
HEllo.
You have so many solutions…
-SetActive(false) the whole object
-Enable=false the Collider component
-Just Change its position with transform.position (it will not trave throught map, it will “teleport”)
-Create a bool variable like “IsDead” so in all collision scripts, check first if is dead or not
And so many more solutions…
I think this question is so basic. You should spend some hours watching tutorials to get ideas and know functionalities of Unity. Never be afraid if spending 1 week only learning!
Good luck!
Bye!