Function RigidBody2D.getCollidingBodies
Returns a list of the bodies colliding with this one. Use contactsReported
to set the maximum number reported. You must also set contactMonitor
to true
.
Note: The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.