using System; using UnityEngine; public class PickUp : MonoBehaviour { private GameManager gameManager; private void Start() { gameManager = GameObject.Find("Game Manager").GetComponent(); } private void OnCollisionEnter(Collision other) { if (other.gameObject.CompareTag("Orb")) { gameManager.UpdateCollectedOrbs(); Destroy(other.gameObject); } else { Debug.Log(other.gameObject.name); } } }