Area2d's are passing through eachother on specific frames
I am building some sort of mario like game and I am having a tough time with the stomp mechanic where the player jumps on an enemy and they die and the player bounces off.
I have things working with the exception of one bug, the player, at times, falls through the enemy's hitbox and goes undetected. Then the player dies as if it just ran into the enemy. Here is an image to illustrate better whats going:
the blueboxes are kinematicbodys with collision shapes. The red and green rectangles are area2ds. Red is for the player and green for the enemy. What is the best way to detect the green box entering the red box if its possible to pass through it between frames? Am I using the right method with area2ds to detect such collisions? Should I be using Raycast2ds? I am a little stumped on this one as I haven't really seen any tutorials that cover this issue bug free.