Hiw to add hitboxes for enemies when making a platformer?

Help. I am making a platformer and i need to know how to make hitboxes where ie stomping on the head of enemy will kill it

2 Likes

Hi @Amiel! You need create for the enemy the new class and use the “Selected Instance” parameter in the Event Manager, look the this event:

Also you can use the this simple project (Used the another logic): https://ready.app.link/YiGIxtl1XR (Open the this project in the your phone, tap the “Remix” button and look the all events and objects in the scene)

Demo (if you jump on the enemy from above he will fall down):

Hitboxes%20-demo

1 Like

https://ready.app.link/4bgEHWv2XR

Or use the code in this demo i made.
The skater has joint behaviour to the abstract ball (stomp class)
The skater has box mask, the ball has circle mask.
The skater is solid, the ball is not.
Tap the floor to make skater rise.
The octopus (octo class clone) is destroyed when the ball beneath the skater collides with the clone.
You can make the ball opacity 0% to hide the ball.

2 Likes