Is it possible for one graph to respect the nodes of another one?

Hi,

To elaborate, I am trying to create a hexagonal graph for static objects that can be spawned dynamically as obstacles on grid nodes due to the art style.

I also want another graph for SMOOTH player movement. I want the player to be able to run in a straight line which it seems is impossible with a hexagonal grid.

I ALSO WANT the player to avoid the static objects placed on hexagonal grid when calculating the path. And I also want the player to recalculate the path if any of the objects spawn when player is following its path

Is this doable using this asset?

Love it so far by the way, great work Aron.

Thanks,
Patrick

Just had a thought, would I need to add “seeker” component to static object and select two graphs (one for the static object and one for player) on the “traversable graphs” property ?

Hi

You do not necessarily need to have a hexagonal graph just because your obstacles are hexagonal.

However even with a hexagonal graph you can use modifiers to smooth/simplify the path.
For example if you attach a Raycast Modifier it can simplify the path so that the agent moves in a straight line more often.

See https://arongranberg.com/astar/docs/modifiers2.html

Hey,

I ended up using hexagonal grid for obstacles because I need them to be placed exactly at the center of hexagonal cell when player places the obstacle on the cell’s area and not the cell’s center.

Thanks for your response regardless!

1 Like