using System.Collections; using System.Collections.Generic; using UnityEngine; public class BasketController : MonoBehaviour { private Animator animator; private void Start() { animator = GetComponent<Animator>(); } private void OnTriggerExit2D(Collider2D collision) { if (collision.CompareTag("Ball")) { animator.SetTrigger("score"); } } }