0 votes

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

in Engine by (248 points)

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 )

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

i think it will be more of a
1. left, right and down
2. top

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.