public void SetWaypointOnBird(Transform bird) { float radius = GetComponent <SphereCollider>().radius; FlockChildForcedWaypoint flockChild = bird.GetComponent <FlockChildForcedWaypoint>(); if (flockChild) { flockChild.WayPoint = transform.position; flockChild.SpawnPoint = RandomPointInsideSpawnCollider(); } }
void OnTriggerEnter(Collider other) { Debug.Log($"{this} trigger enter {other}", this); FlockChildForcedWaypoint flockChild = other.GetComponentInParent <FlockChildForcedWaypoint>(); if (flockChild) { flockChild.transform.position = RandomPointInsideSpawnCollider(); flockChild.Flap(); // prevent it from floating without flapping } }