void OnTriggerEnter(Collider collision) { if (collision.gameObject.tag == "Pickup") { /*FoodTest fT = collision.gameObject.GetComponent<FoodTest>(); * hunger = 0; * // * if (fT != null) * { * * fT.move(); * }*/ hunger = 0; if (GameObject.FindWithTag("World").GetComponent <WorldController>() != null) { GameObject.FindWithTag("World").GetComponent <WorldController>().increaseScore(collision.gameObject.GetComponent <Renderer>().material.color); } snakeController.createNewPart(collision.gameObject.GetComponent <Renderer>().material); Destroy(collision.gameObject); } }