- Edited
Hello, I'm currently making a building system for my 2D top down game. I begin by assigning a preview of the item to be at the player's mouse position and checking if the preview is within a buildable area, the issue is, I'm trying to use Physics2DShapeQueryParameters to check if there are other nodes that should prevent me from placing down the item, like a tree, rock or player already occupying that space.
My main issue is grasping how to correctly use the query. As an example let's say the item I want to place is within the collision layer WORLD and I want to check if there are any other staticBody2D or KinematicBody2D from the WORLD and PLAYER layer in the area the preview is hovering. the closest I got to a woking code was the code bellow:
Any insight is appreciated, thank you!