Hi, How can I do make pathfinding based on collision masks and not on the obstacle objects sprites?
I’m making a topdown 2D Game, therefore longer objects like trees and towers have a way smaller collision masks than there actual object size. it would be great if the pathfinding objects would watch out for the collision masks of obstacles and not for there actual size.
I also tried «Navigation mesh pathfinding (experimental)», but I was not able to find a solution.
Is there another way apart from making a separate collision map for all pathfinding objects?
This would get unnecessary complicated.
The only way I can think of doing it is by using a seperate hidden smaller object as the tree’s pathfinding obstacle. The tree itself wouldn’t have the behavior. You can place it manually or with a for each object using the tree’ bounding box bottom. Minus the height of the hidden hit box depending on where the points on the hidden object are.
I agree sometimes the actual hit box would be useful. You could add a suggestion for a precision style toggle. So, you could switch between the 2 methods. It would probably greatly increase the processing time need to calculate a path.
I also thought about seeting the collision mask as a separate object, but it’s kind of my last resort -.- as I have a lot of different objects and things get really complicated. Let’s see if someone has a even more elegant solution.