To better explain the problem, I’ll describe it like this:
- Object A has the Pathfinding behavior.
- Object B is a Tilemap that has the PathfindingObstacle behavior.
The issue is that when I place Object A in the scene, it doesn’t move because Object B completely covers it. However, within Object B, only a specific tile is set to have collision.
Is there a way for Object A to detect only the tiles with collision in the Tilemap (Object B) so that it can find a path to the player?
One solution I’ve considered is creating a separate Object C (not a Tilemap), assigning it the PathfindingObstacle behavior, and using it solely so that Object A can detect it and calculate a path. However, this is my last resort, since adding more objects would significantly impact the game’s performance — my scene already has a lot of objects.
If you’re talking about the newer tilemap Object then you can use the nav mesh pathfinder behavior and it’s matching obstacle behavior. It uses the hitboxes. The offical pathfinder uses the Object size and sees the tilemap as 1 Object.
1 Like
Sorry, but to be honest I still don’t understand — is it an extension? Because honestly, I just can’t quite get it 
Would it be possible for you to share an image showing the comparison you mentioned?
Alright, I understand. I used the extension and applied it to my objects—one as an enemy with the NavMeshPathfindingBehavior, and the tile map object with the NavMeshPathfindingObstacleBehavior. But it’s still not working.
In the actions, I set the enemy object to move toward the player, but it just stays still.
The tile map has a collision grid assigned. The total number of grids is 79, but the one assigned with collision is number 19. Could it be that it’s not working because the collision grid needs to be number 0?
The ID of the tile shouldn’t matter as long as the only tiles with a collision are the obstacles.
Maybe try it without any collisions. See if the rest of it works and then turn on the collision for any obstacles.
The same rules apply. Make sure the destination is reachable. Openings or hallways or whatever need to be wide enough to fit the entire object.
It helps if the pathfinder object’s origin is in the center and if it’s chasing another object, it helps to target the center of that object.
The Objects should be either the same size or the chasing object should be slightly smaller. Either way, the chasing object needs to fit completely in the target destination.
1 Like