Support Forum

How to make a specific obstacle walkable for a path?

Hey there, we discussed a while back about making all enemies obstacles except for the one you are targeting. That way a path can be constructed without returning as failed.

How do you go about setting an individual element to not be an obstacle before actually making a path.

This is the code I have.

image

Currently the selected obstacle at the end is an obstacle. How would you suggest changing that individual object for the search?

Hi

That’s what you’d do when you construct your TraversalProvider.

var traversalProvider = new BlockManager.TraversalProvider(blockManager, BlockManager.BlockMode.OnlySelector, obstacles);

There you can pass in the list of obstacles you want. To make an individual element walkable, simply don’t include it in the list.