using System.Collections; using System.Collections.Generic; using UnityEngine; public class MoneyColliderController : MonoBehaviour { private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { transform.parent.gameObject.GetComponent().PickUpMoney(); } } }