Collision Flashcards

1
Q

public bool isOnground = true;

A

private void OnCollisionEnter (Collision collision)
{
isOnground =true;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

public bool gameOver = false;

A

private void OnCollisionEnter (Collision collision)
{
if (collision.gameObject.CompareTag(“Ground”))
{
isOnground = true;
} else if (collision.gameObject.CompareTag(“Obstacle”))
{
gameOver = true;
Debug.Log(“Game Over!”);
}
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly