Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Making hitboxes
- bjack26
-
7 posts
Making hitboxes
I am trying to make a hitbox for my arrow in a game and I need help.
- hi875230163394
-
1000+ posts
Making hitboxes
you can make a simple hitbox by having a sprite with
(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)
foreverand 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.
go to [arrow v]
end
(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
-
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
-
500+ posts
Making hitboxes
Use “set ghost effect to 180” block to allow an invisible sprite to still colide. I am trying to make a hitbox for my arrow in a game and I need help.
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)
- lolecksdeehaha
-
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]
- Discussion Forums
- » Help with Scripts
-
» Making hitboxes