Collision of RigidBody2d and StaticBody2d

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bastian Neumann

Hi,

I have the following setup in my project. A Tilemap built in tiled and importet into godot.
A RigidBody2D Object that crashes into the tiles marked with a collision area. The tiles with collison enabled should be a StaticBody2D
The colission works and I can see the Object colliding with the tile. But how can I get a callback that this happens?

I tried connecting to “body_entered” of the RigidBody2D but thit is never called.

I experimented with Area2D nodes and CollisionShape2D. Connecting to “area_entered” did fire a callback. But I still need to know when my objectrs hits a wall.
What am I missing?

:bust_in_silhouette: Reply From: kidscancode

A RigidBody2D will emit the body_entered signal only if the “Contact Monitor” and “Contacts Reported” properties are set. Try setting them to On and 1 respectively.

You can see an example here: https://youtu.be/OzgK__VowVs

Thank you. That was the setting I had overlooked. Thank you.

Bastian Neumann | 2019-05-18 20:16