var home = new Vector3(X,Y,Z); //Needs to be valid X,Y,Z coords
var CreatureId = 10000; //Needs to be actual valid creatureId
var resource = GameManager.Actors.Values.Where(a => a.Position.Distance(home) <= Radius && a.CreatureId == CreatureId).OrderBy(a=>a.Distance).FirstOrDefault();
if (resource == null)
{
//Go Back to start to rescan
await CommonBehaviors.MoveWithin(home, InteractRange, true, true);
}
else if (resource.Distance > InteractRange)
{
await CommonBehaviors.MoveWithin(resource.Position, InteractRange, true, true);
}
else
{
//Do What You Came To Do
await Coroutine.Sleep(4000); //Sleep for 4 secs (like after a cast, or action etc.
}