How to detect a jump attack like Mario?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By icqqq
:warning: Old Version Published before Godot 3 was released.

I am making a 3D platformer and I would like to ask
how can I implement a jump attack like Mario?
In Mario a enemy will get damage if Mario jump on top of it.

I am trying to use raycast and put it on my character foot, but since the raycast is only a straight line, it is not perfect.
I am using KinematicBody for both the character and enemy

So any ideas?
Thanks

you can use an area2D or check for the player’s position upon collision( aka if he is above the enemy or by its side )

rustyStriker | 2018-01-01 11:23

make 2 collision on enemy

  1. for left and right
  2. for top and down
    like a plus sign

if the player touch 1. player die
if the player touch 2. enemy die

Pin | 2018-01-01 17:18

i think it will be more of a

  1. left, right and down
  2. top

rustyStriker | 2018-01-01 18:03