How can I make a hitbox

how can i put a hitbox on a sprites feet to when i touch the white line i lose
Screenshot 2024-04-12 10.51.54 AM

Add a sprite that constantly follows the player, offsetting the Y to their feet. Make this sprite's ghost effect 100%, but don't use the hide block. In this sprite, add the necessary [scratchblocks]<when I am touching [sprite v]>[/scratchblocks] code in that sprite

example code for the hitbox sprite:
when green flag clicked
forever {
go to [player v]
change y by (-10)
if <touching [wall v]> then
broadcast [loose v]
} :: control

You can actually make hitboxes using those blocks:
([left v] of (my [stage v] :: sensing))
You can change "left" to something else to make hitboxes.
This is good because when it changes size it can also follows them.

Adding onto that, you can instead attach the hitbox sprite to the player, with the offset, then the hitbox sprite will always follow the player without having to code that in.

ahhh i love this math. pretty much you need to find the position of the feet relative to the actual sprite (for this you use trial and error) to speed it up you can use the (height of costume) the help and then you can move a new sprite that only covers the feet to the calculated hit box. or you can use the color of the pixels of the feet to act as a hitbox

This is good but it's better to give more simpler explanations, especially if mtrout is a newer Snapper


You're good dw

what about if I dive like this
Screenshot 2024-04-12 11.18.13 AM

code a new hitbox

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.