private void OnTriggerEnter(Collider other) { RugbyBall ball = other.GetComponent <RugbyBall>(); if (ball != null) { ball.GetComponent <Rigidbody>().velocity = Vector3.zero; ball.GetComponent <Rigidbody>().isKinematic = true; ball.transform.SetParent(transform); } }
private void Awake() { _allOtherPlayers = FindObjectsOfType <Passing>().Where(t => t != this).ToArray(); _ball = FindObjectOfType <RugbyBall>(); }