Topic was automatically imported from the old Question2Answer platform.
Asked By
coderpy
I am trying to replicate the Super Mario Thwomp and I created a space where if the player is inside it activates the Thwomp descent. Because he falls before Mario goes under. When I try to get_overlapping_areas it doesn’t find Mario’s KinematicBody2D. Wish someone could explain to me the use of get_overlapping_areas and get_overlapping_bodies?
Below is an image with details.
get_overlapping_bodies() detects PhysicsBody2D types (RigidBody2D, KinematicBody2D, or StaticBody2D).
Note that as stated in the Area2D documentation, the get_overlapping_* methods are only updated once per physics frame. It is typically preferable to use the area’s body_entered and/or area_entered signals.
This would be perfect for your situation. Mario entering the “Thwomp Scan Area” will trigger the body_entered signal and you can make the Thwomp fall.
Thanks for your response. I managed to solve the problem. I’m very grateful.