I’ve made a system with three collision boxes, but I saw some guys talking about other ways to do but I didn’t find out.
I’ve made three boxes because I want my cube hurt me when I hit the corner or the bottom and I kill him when hit the top.
You can also have one collision for the enemy and then simply check if the user is above him by using vector math. Try getting a vector from the enemy to the character and dot it with the up vector of the enemy.
You can threshold the value you get to decide how many degrees you will allow for killing them.
Do you know basic vector math? If not, go learn. You will need it for any game development and many other things in life as well.
Anyways, here goes:
Enemy →e
Player→p
E2pVector = pVector-eVector.
Dot is an operator that takes two normal vectors and provides the cosine of the angle between them. Use the dot node on the two vectors and check if the dot product return value is greater than some threshold you have set.
Please do. Once you have, comment here with whatever you do not understand. It is not useful for me to explain using tools you dont understand. Good luck!