+1 vote

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

in Engine by (1,204 points)

1 Answer

0 votes
Best answer

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

by (291 points)
selected by

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

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.