I have world made with Tileset (some of tiles have static body and CollisionShape2D).
In game scene there is some tilemap in different collision layers.
I want to detect if there is any tiles with Staticbody in the near of player
First I used just Area2D, with getoverlappingbodies() but it didn' t detected anything.
Then i added CollisionShape as child, and it started detecting player. But in the script before calling the function I change the collision mask to different then that in which the Player is. And why it isn't detecting the Tilemap neither the one that is in the same layer as player, nor the one that is in the layer Area should detect.
Can you please explain to me where have i made mistake?
There are 2 Tilemaps: one is in Layer 0 and detects Layer 0, second is in Layer 1 and detects Layer 1. There is also a Player (borh Layer and detection 0) and his child Area2D
the script look so:
(target world = 1, curent world = 0)
and there are 2 efects: Area2D has a child - CollisionShape2D - detects only Player (Rigidbody)
Area2D dosn't have children - detects nothing