I have a function where I attempt to make sure the player can only stomp enemies if they are coming from a specific angle.
The code for the function is on the first screenshot. In the second screenshot, you can see the variables holding the minimum and maximum angles.
I made sure collisions are working via printing silly things like "hi" and "bye". But, if you need me to share screenshots of how player and enemy collisions are set up, I can share them.
Anyway, sadly, no matter the angle the player approaches the enemy, only the code in the "else" section of the function runs. I will admit stuff like "rad_to_deg" and "angle_to_point" are WAY above my level of GDscript knowledge, but I could not find a different way of setting up a stomp mechanic that does not let the player stomp the enemies when coming from all sorts of directions.*
Please, I really want to fix this so I can start building levels and making interesting enemies for this little project of mine. Everything else related to the player works, this is all there is left.
*I tried having so stomping only worked if the player was in the "on_air" state and if the velicity was > 0, meaning the player was falling down and not rising up, but it was VERY janky...