I’m working on a project where I’m creating “roads” using a spline tool. When I make a spline, I want to alter the penalty of the gridgraph nodes along the spline to make them the easier pathway.
I’ve got the grid set up and working correctly and have verified that the penalty works when using a GraphUpdateScene component with arbitrarily placed points (noted just to say that everything up to this point is working great as intended).
The following are my two attempted solutions:
- I converted the spline into a list of points and inserted those into a GraphUpdateScene. I can’t make it convex as that doesn’t follow the spline and even when adding those points back in reverse order to create a “whole” shape it never overlaps with the center of a node and so doesn’t mark any nodes.
- Convert the spline into a 3D mesh collider. Doing this I can set the collider’s layer and in the grid graph settings I can make it detect those overlapping nodes as not walkable. However, there doesn’t seem to be a way to do that and make them add a penalty or tag instead.
Option 2 is really the easiest solution for me but I cannot figure out how to make the nodes set their penalty based on a collider, only their walkability. If there is a way to do this it would be super helpful. Thank you!