Answer the question
In order to leave comments, you need to log in
Unity C# - How to make a level restart 2-3 seconds after character death?
Guys, help me solve the problem, otherwise my head is already swollen. I am just starting my journey in learning C# and Unity respectively.
Problem:
The player "disappears" when touching the "Enemy" tag and after that it is necessary to restart the level. I have already reviewed hundreds of articles and videos, not a single proposed option works.
Here is the code:
private void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.tag == "Enemy")
{
Instantiate(deathplayer, transform.position, Quaternion.identity);
this.gameObject.SetActive (false);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question