Benefit of using smaller collision shape

Is there a benefit of using collision shape smaller than the platform itself?

In this case, yes. Because the Player’s CollisionShape is also fairly small and positioned toward the bottom of the Player sprite, these two CollisionShapes result in more precise collision when you consider that the platforms can be travelled through from the bottom. If the Player’s CollisionShape covered the entire Player sprite, you could activate a jump by having no more than the top of the Player’s head clipping through the platform from below.

There is a balance to be struck however; thin CollisionShapes are less reliable because of the possibility of fast-moving objects going straight through them. This is why Kaan’s Platform CollisionShape is thin, but not 1px-thin. The collision here also doesn’t need to be so precise that the Player will always jump from the exact surface of the platform, which is why the Player’s CollisionShape has a bit more height to it.

All of that said, could you put a shorter CollisionShape on the Player and a taller one on the Platform? Or have more evenly-sized CollisionShapes? Yes to both. That part I think was just Kaan’s preference =)

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

Privacy & Terms