Discuss Scratch

bjack26
Scratcher
7 posts

Making hitboxes

I am trying to make a hitbox for my arrow in a game and I need help.
hi875230163394
Scratcher
1000+ posts

Making hitboxes

you can make a simple hitbox by having a sprite with
forever
go to [arrow v]
end
and than make it so that the collision detection for the arrow is in the hitbox code instead of the arrow code, you can make the hitbox any shape you want.

(also make sure to set the ghost effect to 100 if you want the hitbox to be invisible, just doing “hide” wont work because that disables collisions, while ghost allows it to be invisible and collide with stuff)
bjack26
Scratcher
7 posts

Making hitboxes

Thank you and if I'm right, to make it so it's only effected by the hit box I just need to remove a touch sensor from the arrow and move it to my hitbox and change the touch sensor in my ball.
Gato_Amigo111
Scratcher
500+ posts

Making hitboxes

bjack26 wrote:

I am trying to make a hitbox for my arrow in a game and I need help.
Use “set ghost effect to 180” block to allow an invisible sprite to still colide.

It looks like this:
change [ ghost] effect by (180)

If you need any help, look at my project “Cat Warrior” and see the “Cat Warrior Hitbox” sprite. It shows you what you would need for a working hitbox. If you need any more help, comment on my pf.

Last edited by Gato_Amigo111 (Feb. 14, 2022 21:35:50)

hiPeeps124816
Scratcher
500+ posts

Making hitboxes

THis would fit more in help with scripts
lolecksdeehaha
Scratcher
1000+ posts

Making hitboxes

Don't use a separate sprite, if you make a separate costume, you can do this:
... // in the arrow moving loop
switch costume to [hitbox v]
... // move arrow and anything involving collisions
switch costume to [arrow v]

Powered by DjangoBB