Manual: Lightweight Object (Area2DGameObject)

Overview

The Area2DGameObject, introduced in version 1.2.0, is a game object designed to reduce operational load by omitting “physical collision” functionality compared to traditional GameObjects.
Since it cannot perform “physical collisions,” it is unsuitable for characters such as players or enemies that would cause issues if they passed through walls, or for objects like destructible walls that serve as obstacles for characters. However, replacing non-critical objects with Area2DGameObject can help lighten the game’s overall load.

Technical Overview

Traditional GameObjects are custom nodes derived from the CharacterBody2D node, whereas Area2DGameObject, as its name suggests, is derived from the Area2D node.
For detailed differences between these nodes, please refer to the following manual:

What You Cannot Do Without “Physical Collision”

  • Cannot collide with other objects.
  • Cannot move along the shape of floors or walls, such as sliding down slopes.
  • Template movement actions like “bounce movement” or “prevent falling off ledges” will not function.
    For properties that do not work with Area2DGameObject, warning messages will be displayed.

What You Can Still Do Without “Physical Collision”

  • Can detect contact with other objects, so contact-based conditions such as wall collision detection will function normally.
  • Can still be affected by gravity.
    Think of it as a sensor that has no physical presence but can detect contact. Essentially, all functionalities except those listed under “What You Cannot Do” above will work.
    You can simulate collision handling by constructing behaviors such as “when touching a tile, set movement speed to 0” using visual scripting, allowing you to pseudo-implement features like items scattering when enemies are defeated. However, be cautious, as this may increase the likelihood of objects overlapping or clipping into each other.

How to Use Area2DGameObject

Since Area2DGameObject is compatible with existing GameObjects, you can simply right-click a GameObject node and select “Change Type” to convert it to Area2DGameObject.
Conversely, you can also switch an Area2DGameObject back to a GameObject in the same manner.