private void OnTriggerStay(Collider other) { if (!deactivateFirefly) { // Follow fire flies attract object (AttractBall or controller) FirefliesInteraction fireFliesAttract = other.gameObject.GetComponent <FirefliesInteraction>(); if (fireFliesAttract && fireFliesAttract.shouldFollow) { StartMovement(other.gameObject.transform.position); } } }
private void Awake() { firstFireflies = GameObject.Find("Fireflies").GetComponent <Fireflies>(); attractBall = GameObject.Find("AttractBall")?.GetComponent <FirefliesInteraction>(); }