Answer the question
In order to leave comments, you need to log in
Problem with return?
This method weighs on the character
void OnTriggerEnter2D(Collider2D col)
{
if (col.gameObject.name == "set5")
{
if (wer == 4)
{
wer--;
return;
}
if (wer == 3)
{
wer--;
}
if (wer != 4 || wer != 3)
wer = 5;
}
if (col.gameObject.name == "wall3")
{
if (wer == 5)
{
wer--;
return;
}
if (wer == 1)
SceneManager.LoadScene("Level4");
if (wer != 5 || wer != 1)
wer = 5;
}
if (col.gameObject.name == "wall4")
{
if (wer == 2)
{
wer--;
return;
}
if (wer != 2)
wer = 5;
}
}
if (wer == 5)
{
wer--;
return;
}
if (wer == 4)
{
wer--;
return;
}
if (wer == 2)
{
wer--;
return;
}
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