Beispiel #1
0
    private void OnCollisionEnter(Collision collision)
    {
        //If the player collides with the obstacle - make the player lose a life then destroy the obstacle so the player can keep moving

        if (collision.collider == m_Player)
        {
            m_MainController.LoseLife();
            StartCoroutine(DestroyObject());
        }
    }