- Areas are great for bullets and other projectiles that hit and deal damage, but don't need any other physics such as bouncing.
- Use a large circular area around an enemy to define its "detect" radius. When the player is outside the area, the enemy can't "see" it.
- "Security cameras" - In a large level with multiple cameras, attach areas to each camera and activate them when the player enters.
See the :ref:`doc_your_first_2d_game` for an example of using Area2D in a game.
Area influence
--------------
The second major use for area nodes is to alter physics. By default, the area
won't do this, but you can enable this with the *Space Override* property. When
areas overlap, they are processed in *Priority* order (higher priority areas are
processed first). There are four options for override:
-*Combine* - The area adds its values to what has been calculated so far.
-*Replace* - The area replaces physics properties, and lower priority areas are ignored.
-*Combine-Replace* - The area adds its gravity/damping values to whatever has been calculated so far (in priority order), ignoring any lower priority areas.
-*Replace-Combine* - The area replaces any gravity/damping calculated so far, but keeps calculating the rest of the areas.
Using these properties, you can create very complex behavior with multiple
overlapping areas.
The physics properties that can be overridden are:
-*Gravity* - Gravity's strength inside the area.
-*Gravity Vec* - Gravity's direction. This vector does not need to be normalized.
-*Linear Damp* - How quickly objects stop moving - linear velocity lost per second.
-*Angular Damp* - How quickly objects stop spinning - angular velocity lost per second.
Point gravity
~~~~~~~~~~~~~
The *Gravity Point* property allows you to create an "attractor". Gravity in the
area will be calculated towards a point, given by the *Gravity Vec* property.
Values are relative to the Area2D, so for example using ``(0, 0)`` will attract
objects to the center of the area.
Examples
~~~~~~~~
The example project attached below has three areas demonstrating physics