I have a galaxy of stars, a group of spheres, and I’m trying a make a route plotting method to plot a route from one system to another.
I’m thinking something like:
GameObject currentSystem;
GameObject targetSystem;
List<GameObjects> Waypoints;
float maxPlotDistance;
float jumpDistance;
void PlotRoute()
{
var totalStraightLineDistance = Vector3.Distance(currentSystem, tagetSystem);
if (totalStraightLineDistance < maxPlotDistance)
{
// get all stars around currentStar with jumpDistance Raidus, OverlapSphere??
// find star out of that group that is closest to target
// add to waypoints and repeat until reach target star
}
else { "Target To far to plot" }
}
Is this the way I should do this? Any help is appreciated.