Overview
The Area2DGameObject, introduced in version 1.2.0, is a game object designed to reduce processing load by omitting features related to physical collisions, compared to the conventional GameObject.
Because it cannot perform physical collisions, it is not suitable for characters such as players or enemies—where passing through walls would be problematic—or for objects that act as physical obstacles, such as destructible walls.
However, by replacing objects that do not require physical collision with Area2DGameObject, you can improve overall game performance and reduce processing costs.
Technical Overview
The conventional GameObject is a custom node that inherits from CharacterBody2D, whereas Area2DGameObject, as its name suggests, inherits from Area2D.
For detailed differences between these nodes, please refer to the following manual:
Limitations Due to the Lack of Physical Collision
Because physical collision is not supported, the following behaviors are not possible:
- It cannot collide with other objects.
- It cannot move along the shape of floors or walls, nor slide on slopes.
- Template movement actions such as “Bounce Movement” and “Do Not Fall From Ledges” will not function.
For properties that do not work with Area2DGameObject, warning messages will be displayed to indicate the limitation.
What Is Still Possible Without Physical Collision
- It can still detect contact with other objects, so contact-based conditions (such as detecting contact with walls) will function correctly.
- It can still be affected by gravity.
Think of it as a sensor: it has no physical body, but it can detect interactions.
In general, all features other than those listed under “Limitations” will work as expected.
By using visual scripting to define behaviors such as “When touching a tile” or “Set movement speed to 0”, you can create pseudo-collision behavior. This makes it possible to simulate effects like items scattering when an enemy is defeated.
However, since this is only a simulation, issues such as objects overlapping are more likely to occur, so please use caution.
How to Use Area2DGameObject
Area2DGameObject is compatible with existing GameObjects. You can switch by right-clicking a GameObject node and selecting “Change Type”, then choosing Area2DGameObject.
Likewise, you can switch an Area2DGameObject back to a GameObject in the same way.