I always use the signal body_entered to detect collisions. This signal has a parameter with the body of the collision. But here’s the problem: if it collides with the shape of a tile it will always return the TileMap object, independently of which tile we collide with.
In my case I wanted to detect the house where the villager is, so his projectiles don’t collide with it but can still collide with other tiles like trees:
The basic command to compile an export template is:
Where platform could also be windows, android… instead of linuxbsd. Both templates can be compiled at the same time using template_debug/template_release.