Example #1
0
    void OnCollisionEnter(Collision other)
    {
        if (other.transform.tag == "walkable")
        {
            if (GameController_script.start)
            {
                Instantiate(ring_prefab, transform.position, Quaternion.identity);
                rb.AddForce(new Vector3(0, 500, 0));
            }
        }
        else
        {
            transform.position          = spawn.transform.position;
            rb.velocity                 = new Vector3(0, 0, 0);
            GameController_script.start = false;
            sector = 0;

            cubeSpawner_script.resetCubes();
        }
    }