Hitboxes like JSAB

I need help on making an animation hitbox. For example, a square hits the player, and the player takes damage. Can anybody help me with this code please?

What Wick Editor Version are you using?
1.19.3

Describe the Problem
I don’t know how to make an animated hitbox.

What have you tried so far?
I have tried making hitboxes and selecting my drawings that are supposed to be animated and moving across the screen,

have you tried using if (this.hits(that)) and put the other player in the animation as long as it’s not together it should work

Hey @Dol_Boonsomchin,
You can create hitboxes using the hits() function.
On Update script:

if (a.hits(b) {
// Do something
}

More information can be found here.
(Scroll down to the object section and select hits not hitTest because It is outdated.)

1 Like

well (when I collab ) we make when the enemy hits player …player’s heart decrease …so maybe this can help you?
action rpg 0.159-18-2021_9-57-22.wick (2.7 MB)

thx for explaining in detail

1 Like

TYSM! This helped me out a lot!

Thanks! It works! I appreciate your help!

1 Like

Yes I have already tried that.