Changing penalty of area defined by procedurally generated mesh

So, I’ve been playing around with this for a while now and figure it’s time I just ask about it.

First off, I’m using a grid graph for my pathing. I have it set up so the player can procedurally generate a road object by defining a bezier curve. The mesh is generated on the fly and is completely flat and will form to terrain.

My problem comes when I try to modify the penalty on JUST the road. When I use a GraphUpdateObject to define the parameters, it just doesn’t do anything to it; it’s as if the bounds I’ve supplied from the road object mean nothing. I’ve debug.logged to see if there was some error calculating the bounds before I used it as a parameter, but it’s perfectly fine.

I’ve tried GraphUpdateScene as well and just get unuseable results.

tl;dr Any ideas how change the penalty on an area defined by a procedurally generated mesh?

Alright, so I’ve finally solved it. It was two errors on my part - one being just some silly programming error. The other was that I fed the same set of vertices in the same order to the GraphUpdateScene as I did to the mesh for the object. The order of the vertices were set up in triangles from one end to the other and complicated things a bit when it came to the GraphUpdateScene defining the poly.

Anyway, problem solved! My bad heh

1 Like