How to set some part of a plane/terrain unwalkable

Firstly thanks Aron for the pathfinding scripts, they are great! :slight_smile:

I have a plane (can switch to a terrain if I need to) which I want only some of it to be walkable. Take this example:

I want the black area to be non-walkable. I only want the pathfinding script to find a path from the left hand side of the screen to the right hand size of the screen using the white bits only. How can I do this?

Also, once I’ve generated a path, how can I update it for eg if something has blocked the path?

And finally, is it possible to make a path follow/go through set waypoints?

Thanks :slight_smile:


It seems you have a texture as input.
If you are using the pro version, you can use the Grid Graph Settings -> Extra -> Use Texture option to use the texture data as walkability data. That would do it.

You can also use invisible colliders, that would work just as well.

You can update the path by simply calling seeker.StartPath (or whatever you are using) again.

Yes, that is possible, I have an example script here

Perfect, perfect and perfect - thanks! :slight_smile:

Not sure I’m correctly reading this thread, so apologies if I’ve brought it back for no reason. What I am hoping to do is get Astar to scan an area for a specific texture and create walkable area based on where that texture is. In the image below you can see a bunch of paths on the terrain, is there a way to get graph in Astar to scan this area and find out where that texture (Dirt) is and have make that a walkable area?