Hitbox Attack System Unity2D

Yeap, that’s zero from megaman. Do you know how he deals damage to enemies when he uses his sword? Well, the answer is simple…

Hitbox Attack System!

Maybe you’ve heard about RayCast in Unity. You probably use it to pick objects with the mouse, create lasers from one point to another etc.

This can be also used to make player attacks, detect the enemies inside that attack area and make damage to them.

In this simple line of code we are creating an OverlapCircleAll, we can detect all enemies into a certain circle with a custom size.

Deal Damage To Enemies

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response