The pathfinding page makes no mention of how the Pathfinding behavior handles multiple layers. Does it keep a separate grid for each layer of the game?
If I add two instances of an object with the behavior to different layers with different obstacles, how will they behave?
I think the layers are just the visual aspect, for having objects displayed above others. Objects can still interact with each other on other layers to my understanding.
Develop games in your browser. Powerful, performant & highly capable.
I was under the impression that the pathfinding grid would only take the solids in the same layer into account. It would make sense from the way the manual is written that the pathfinding object takes all solids when building the grid. That will complicate things. I need the ability to have seperate pathfinding grids. Think about the different floors of a house, each can have people moving around, each with different object arrangements.
I suppose I could create a different object with the pathfinding behavior for each floor, and give each slightly different pathfinding values so they are tracked separately. The pathing is based on a tilemap, so I could just add the tilemap for each floor as the obstacle for that floors pathfinding behavior. Add each object to the character container and pin the character to it, then just call the object that matches the floor the character is on to move the character with pathfinding specific to that floor. It should work, but will make adding single objects more complicated since there is no action to remove a specific obstacle, I guess I could keep a list of every obstacle for each floor and if one is removed, remove it from the list, wipe the pathfinding obstacles and readd them all on the list. Should be able to get away with only rebuilding the area of the grid that was effected. If its alot of objects then the removing action could start to get expensive.