Last, but not least, we have our flock target. To reiterate, you can use any art you like, or you can stick with the handsome little sphere in the provided sample project. The code for the target component is in the TargetMovement.cs file. The contents look like this:
using UnityEngine;public class TargetMovement : MonoBehaviour { [SerializeField] private Vector3 bounds; [SerializeField] private float moveSpeed = 10.0f; [SerializeField] private float turnSpeed = 3.0f; [SerializeField] private float targetPointTolerance = 5.0f; private Vector3 initialPosition; private Vector3 nextMovementPoint; private Vector3 targetPosition; private void Awake() { initialPosition = transform.position; CalculateNextMovementPoint(); } private ...