I have a Button that is an Area2D and it activates a Switch that is a StaticBody2D that is a child node of the button. However, if the switch door enters the Area2D button with the collision layers set up the button does not detect it. The button can detect Characterbodies and Rigidbodies fine but not static bodies. I checked everything and I have no idea why this occurs.
Can you show the scene organization and the code?
Do you have monitorable turned off on the area? if yes, its a known bug that it wont detect staticbodies when monitorable is turned off.
Monitorable is turned off but enabling it doesn’t change anything
what about monitoring?
Monitoring is also on
Then please provide more information like collision layer and mask of the objects. And keep monitorable turned on
The button is an Area2D with no collision layers and it has collision masks of layers 2, 3, 4 and 7. While the StaticBody2D switch door has the collision layers of 1 and 7 with no collision masks.
And how did you connect the body_entered signal?
I connected it using the signal section from the node tab next to the inspector tab. It can detect rigid bodies and character bodies but not staticbodies
can you show the inspector tab of the area and the staticbody?
Do you move the staticbody?
I rotate the static body for the door by rotating the pivot point since I can’t change the pivot point of the staticbody
Staticbodies are not meant to be moved. Maybe try out an animatablebody?
It still doesn’t detect the animatiblebody either
Nvm, I just disabled Sync to Physics, it works now.
tysm