This is ticking me off

I changed the opacity of an object, and now it has an infinite collision. It’s a private game, and it makes no sense. Reloading does nothing, and it was caused from me changing the color of a long rectangular sprite from 50 opacity to 18. I can’t undo it anymore, and it is unfix-able. @grazer
https://flowlab.io/game/view/1983146#

Maybe don’t put a hashtag at the end of the link?

1 Like

https://flowlab.io/game/view/1983146
No it still doesn’t work. Idk if it’s because it’s private or it’s missing a digit somewhere.

It’s private, as i said. I added that since the game is supposed to be completely private and grazer can access private games.

I found the issue, even though it was a rectangle, it was providing a circular polygon hitbox, which was odd, so I just had to change it to rectangle.

Doesn’t make much sense that changing the color of it did all of this as well as the polygon being a perfect circle…

Hey @Galactian - I’m not sure what “infinite collision” means, but you should keep in mind that the pixels in your sprite are important to the collision detection. You can see the general collision shapes (in a hacky, unofficial way) with ctrl+shift+d

I assume you’re talking about the “death object”?

  • This object is a rectangle, but using a “polygon” collision shape for some reason, which will be worse in almost every way than a simple rectangle collision shape if you want a rectangle collider. If you make it a rectangle instead, it will probably do what you want.
  • This object’s alpha channel is below the marching squares polygon builder’s alpha channel threshold, so it’s giving up and generating a circle instead. If you just want it to be less transparent, you can make the pixels in the sprite solid, but lower the display alpha using an Alpha block (in properties)
  • When you said you said the alpha channel is set to “18”, do you mean 18.0 (decimal) or 0x18 (hex)?
  • What can’t you undo?

3 Likes

I fixed this issue, at first I thought it had infinite size (hitbox was everywhere) because after changing the color’s alpha (in the sprite editor) it kept killing my player. I eventually figured out that the polygon hitbox of it was a circle, for some reason, setting it to rectangle fixed it.

The reason is that the alpha channel was low enough that the polygon collider value ignored them, gave up, and generated a default circle.

When considering what collision shape to use, look at them from left->right in the interface:

  1. Circle: Use this any time you can! Circles are reliable, they are fast, they are easy to generate (just a simple euclidean distance)
  2. Rectangle: Use this if you can’t use a Circle. Not too much slower than a circle, and very reliable and predictable
  3. Capsule: Use this if you want to make corner snags less common for a player object, it also has no friction on the sides
  4. Use this if you need a complicated shape not listed above, but that has an important collision shape (e.g. a ramp or some weird arbitrary shape). This is not as fast to collide as the others, but uses Marching squares - Wikipedia to generate a shape using the contours of your sprite (as close as is practical, anyway). It will usually make a composite polygon from a bunch of triangles, so avoid this one unless you need it for a specific purpose.
4 Likes

grazer meme?

1 Like

This is useful information…Is there any way we could get the option to customize the lines and verteces of hitboxes?

3 Likes

Yeah, customizable hitboxes are needed and will be added.

8 Likes

I was just about to ask that-

Could we have hit boxes that will be on the sprite like:
I do an animation and the hitbox changes with it.
EX:
My animation is square, triangle, circle.
When the square frame is put in, the hit box changes into a square
.
When the triangle frame is put in, the hit box changes into a triangle
.
When the circle frame is put in, the hit box changes into a circle

3 Likes

This would absolutely be a good feature to have

1 Like

I’ve made a complex request on this

3 Likes