How to make a hollow rectangle shape for a collision shape2d

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rustyStriker
:warning: Old Version Published before Godot 3 was released.

is it possible to make a hollow rectangle to use for the collision shape2d of the outer walls of the map?

:bust_in_silhouette: Reply From: Aaron

What you’d do is create a StaticBody2D for the outer map boundary, and under that create four rectangle CollisionShape2Ds for the walls.

Yeah but is there a way to do it without four rectangles and by using one?

rustyStriker | 2016-09-03 18:09

You could also use a CollisionPolygon2D with its Build Mode set to Segments, then draw an outline around your map. This wouldn’t be a rectangle with a hole cut out. This would be an outline of your map.

Aaron | 2016-09-03 20:47