How and is it possible to make custom hitboxes for sprites

something i want for my sprites it to draw a custom hitbox, I don’t like that the pixels determine the hitbox because that will set restrictions for animating sprites, like if I draw my sprite in one frame a little too big, then it will sort of clip into the walls, please implement this feature makecode or maybe it already exists, it’s just that I don’t know how to get to it, and if thats the case pls help me i beg

1 Like

make another sprite that does the hitbox checking and set the player to it’s location. the sprite should always be a rectangle

make 2 sprites, one for the image and one for the hitbox (fill the hitbox in with a colour).

Then ghost the image sprite so it doesn’t collide with anything and make the hitbox invisible (make sure you use the block that toggles it invisible)

Then use a game update loop set the image sprite position to the hitbox (make sure you control the movement of the hitbox, not the player sprite)
Also keep in mind you can code in offsets if you want more precise control of where you want the hitbox to be relative to the sprite image

1 Like

how do I make invisible, and if you say change something in javascript, then imma just stick with what I have (i only code in block code cuz im bad at python as well even tho im in a computer science class)

still wish for not rectangular hitboxes

they already arent?

1 Like

no they are

wait I worded that weird. Aren’t they already non-rectangle? Or are you talking about tileMap collisions?

there is a block to set sprite invisible

1 Like

no they are I’m pretty sure of that correct me if I’m wrong tho

thanks yall, maybe ill use it, but orobably no for my next game cuz too lazy

1 Like