public override void OnStateChanged(BotController bot, BotState previousState) { Vector3 wp = bot.GetRandomWaypoint(); bot.SetPathDestination(wp); // Set a random waypoint as destination bot.StoppingDistance = bot.waypointSkipDist; }
public override void UpdateState(BotController bot) { if (bot.IsPathEmpty()) // if waypoint is reached or path is empty, reset to new waypoint { Vector3 newWaypoint = bot.GetRandomWaypoint(); bot.SetPathDestination(newWaypoint); } }