WorldBoundaryShape2D Collision Shape

For this exercise I used WorldBoundaryShape2D instead of a RectangleShape2D. I found this was helpful because it infinitely spans the desired direction without needing to adjust size manually. Of course, this could get tricky to use if you have a complex level design with multiple drops at different Y levels, but for this I found it was somewhat simple and won’t need to be adjusted if the level remains relatively flat.

From the docs:

A 2D world boundary shape, intended for use in physics. WorldBoundaryShape2D works like an infinite straight line that forces all physics bodies to stay above it. The line’s normal determines which direction is considered as “above” and in the editor, the smaller line over it represents this direction. It can for example be used for endless flat floors.

4 Likes

Ah, nice one, did t even know that was a thing.
Cheers for sharing that one :+1:

1 Like

Privacy & Terms