Example #1
0
    void OnTriggerEnter(Collider other)
    {
        Debug.Log("I was in trigger");
        if (other.tag == "Player 1")
        {
            Debug.Log("I entered first trigger");
            Destroy(gameObject);
            player1Controller.AddSpeed(speed, time);
        }

        if (other.tag == "Player 2")
        {
            Debug.Log("I entered second trigger");
            Destroy(gameObject);
            player2Controller.AddSpeed(speed, time);
        }
    }