You are reading the
(unstable) version of this documentation, which may document features not available
or compatible with Godot 3.x.
Checking the stable version of the documentation...
Work in progress
Godot documentation is being updated to reflect the latest changes in version
4.0. Some documentation pages may
still state outdated information. This banner will tell you if you're reading one of such pages.
The contents of this page are up to date. If you can still find outdated information, please open an issue.
Inherits: Shape2D < Resource < RefCounted < Object
Rectangle shape resource for 2D physics.
2D rectangle shape to be added as a direct child of a PhysicsBody2D or Area2D using a CollisionShape2D node. This shape is useful for modeling box-like 2D objects.
Performance: Being a primitive collision shape, RectangleShape2D is fast to check collisions against (though not as fast as CircleShape2D).
Vector2 size =
The rectangle's width and height.