using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using Unity.Netcode;

public class GoalArea : NetworkBehaviour
{


    public UnityEvent OnGoalTriggered;


    public void OnTriggerEnter(Collider other)
    {
        if(other.tag == "Ball")
        {
            OnGoalTriggered?.Invoke();
            other.gameObject.transform.position = Vector3.zero;
            other.gameObject.GetComponent<Rigidbody>().velocity = Vector3.zero;
        }

    }
}
