What i want is that in buildMode the collision of the Building do not affect other shapes. Only be a visible Sprite to show where the Building can placed. If the building is placed then it needs the collision back again to prevent players to run through it.
Szenario (short to explain):
var allowPlace = false
var buildMode = false
# on BuildMode Start:
buildMode = true
# on Fixed Process:
var b = Buidling01.get_node("Collision")
# How to do that here in a right way to check overlapping or collision ?
if (b.is_colliding() || b.get_overlapping_bodies().size() > 0):
allowPlace : false
# on Mouseclick
buildMode = false
print("OMG! You cant place a building on a Player or a collision map tile!")
Well I tried to use an Area2D instead of a KinematicBody2D for the Building01. There i can check if the Building01 is over another Shape but then i still have no collission when it is placed. That means my Player can run through the Building (although is_trigger equals false when placed).
If i use a KinematicBody2D then i cant really check if the Building is acutally over a Player or StaticBody2D with collision (while buildMode) but here i have the collision what prevents the player to run through the building.
I also tried to use a KinematicBody2D AND the Area2D in the [Building01] Node. But then they detect itselft as overlapping shape what will always return the wrong value for allowPlace.
I´m really confused how to fix that problem. Can anyone help me here ?