General-purpose area node for detection and 3D physics influence.
    public class Area : CollisionObject

3D area that detects CollisionObject nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).

Inheritance Chain

Constructors

    public Area()

Signals

    "area_entered" (Area area)

Emitted when another area enters.

    "area_exited" (Area area)

Emitted when another area exits.

    "area_shape_entered" (int area_id, Area area, int area_shape, int self_shape)

Emitted when another area enters, reporting which areas overlapped.

    "area_shape_exited" (int area_id, Area area, int area_shape, int self_shape)

Emitted when another area exits, reporting which areas were overlapping.

    "body_entered" (Node body)

Emitted when a physics body enters.

The body argument can either be a PhysicsBody or a GridMap instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).

    "body_exited" (Node body)

Emitted when a physics body exits.

The body argument can either be a PhysicsBody or a GridMap instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).

    "body_shape_entered" (int body_id, Node body, int body_shape, int area_shape)

Emitted when a physics body enters, reporting which shapes overlapped.

The body argument can either be a PhysicsBody or a GridMap instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).

    "body_shape_exited" (int body_id, Node body, int body_shape, int area_shape)

Emitted when a physics body exits, reporting which shapes were overlapping.

The body argument can either be a PhysicsBody or a GridMap instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).

Properties

    public float AngularDamp { get; set; }

The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from 0 (no damping) to 1 (full damping).

    public string AudioBusName { get; set; }

The name of the area’s audio bus.

    public bool AudioBusOverride { get; set; }

If true, the area’s audio bus overrides the default audio bus.

    public uint CollisionLayer { get; set; }

The area’s physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also CollisionMask.

    public uint CollisionMask { get; set; }

The physics layers this area scans to determine collision detection.

    public float Gravity { get; set; }

The area’s gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.

    public float GravityDistanceScale { get; set; }

The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.

    public bool GravityPoint { get; set; }

If true, gravity is calculated from a point (set via GravityVec). See also SpaceOverride.

    public Vector3 GravityVec { get; set; }

The area’s gravity vector (not normalized). If gravity is a point (see GravityPoint), this will be the point of attraction.

    public float LinearDamp { get; set; }

The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from 0 (no damping) to 1 (full damping).

    public bool Monitorable { get; set; }

If true, other monitoring areas can detect this area.

    public bool Monitoring { get; set; }

If true, the area detects bodies or areas entering and exiting it.

    public float Priority { get; set; }

The area’s priority. Higher priority areas are processed first.

    public float ReverbBusAmount { get; set; }

The degree to which this area applies reverb to its associated audio. Ranges from 0 to 1 with 0.1 precision.

    public bool ReverbBusEnable { get; set; }

If true, the area applies reverb to its associated audio.

    public string ReverbBusName { get; set; }

The reverb bus name to use for this area’s associated audio.

    public float ReverbBusUniformity { get; set; }

The degree to which this area’s reverb is a uniform effect. Ranges from 0 to 1 with 0.1 precision.

    public SpaceOverrideEnum SpaceOverride { get; set; }

Override mode for gravity and damping calculations within this area. See SpaceOverride for possible values.

Methods

    [Obsolete("GetAngularDamp is deprecated. Use the AngularDamp property instead.")]
    public float GetAngularDamp()

Getter for AngularDamp

    [Obsolete("GetAudioBus is deprecated. Use the AudioBusName property instead.")]
    public string GetAudioBus()

Getter for AudioBusName

    [Obsolete("GetCollisionLayer is deprecated. Use the CollisionLayer property instead.")]
    public uint GetCollisionLayer()

    public bool GetCollisionLayerBit(int bit)

Returns an individual bit on the layer mask.

    [Obsolete("GetCollisionMask is deprecated. Use the CollisionMask property instead.")]
    public uint GetCollisionMask()

    public bool GetCollisionMaskBit(int bit)

Returns an individual bit on the collision mask.

    [Obsolete("GetGravity is deprecated. Use the Gravity property instead.")]
    public float GetGravity()

Getter for Gravity

    [Obsolete("GetGravityDistanceScale is deprecated. Use the GravityDistanceScale property instead.")]
    public float GetGravityDistanceScale()

Getter for GravityDistanceScale

    [Obsolete("GetGravityVector is deprecated. Use the GravityVec property instead.")]
    public Vector3 GetGravityVector()

Getter for GravityVec

    [Obsolete("GetLinearDamp is deprecated. Use the LinearDamp property instead.")]
    public float GetLinearDamp()

Getter for LinearDamp

    public Godot.Collections.Array GetOverlappingAreas()

Returns a list of intersecting Areas. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.

    public Godot.Collections.Array GetOverlappingBodies()

Returns a list of intersecting PhysicsBodys. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.

    [Obsolete("GetPriority is deprecated. Use the Priority property instead.")]
    public float GetPriority()

Getter for Priority

    [Obsolete("GetReverbAmount is deprecated. Use the ReverbBusAmount property instead.")]
    public float GetReverbAmount()

Getter for ReverbBusAmount

    [Obsolete("GetReverbBus is deprecated. Use the ReverbBusName property instead.")]
    public string GetReverbBus()

Getter for ReverbBusName

    [Obsolete("GetReverbUniformity is deprecated. Use the ReverbBusUniformity property instead.")]
    public float GetReverbUniformity()

Getter for ReverbBusUniformity

    [Obsolete("GetSpaceOverrideMode is deprecated. Use the SpaceOverride property instead.")]
    public SpaceOverrideEnum GetSpaceOverrideMode()

Getter for SpaceOverride

    [Obsolete("IsGravityAPoint is deprecated. Use the GravityPoint property instead.")]
    public bool IsGravityAPoint()

Getter for GravityPoint

    [Obsolete("IsMonitorable is deprecated. Use the Monitorable property instead.")]
    public bool IsMonitorable()

Getter for Monitorable

    [Obsolete("IsMonitoring is deprecated. Use the Monitoring property instead.")]
    public bool IsMonitoring()

Getter for Monitoring

    [Obsolete("IsOverridingAudioBus is deprecated. Use the AudioBusOverride property instead.")]
    public bool IsOverridingAudioBus()

Getter for AudioBusOverride

    [Obsolete("IsUsingReverbBus is deprecated. Use the ReverbBusEnable property instead.")]
    public bool IsUsingReverbBus()

Getter for ReverbBusEnable

    public bool OverlapsArea(Node area)

If true, the given area overlaps the Area.

Note: The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.

    public bool OverlapsBody(Node body)

If true, the given physics body overlaps the Area.

Note: The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.

The body argument can either be a PhysicsBody or a GridMap instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).

    [Obsolete("SetAngularDamp is deprecated. Use the AngularDamp property instead.")]
    public void SetAngularDamp(float angularDamp)

Setter for AngularDamp

    [Obsolete("SetAudioBus is deprecated. Use the AudioBusName property instead.")]
    public void SetAudioBus(string name)

Setter for AudioBusName

    [Obsolete("SetAudioBusOverride is deprecated. Use the AudioBusOverride property instead.")]
    public void SetAudioBusOverride(bool enable)

Setter for AudioBusOverride

    [Obsolete("SetCollisionLayer is deprecated. Use the CollisionLayer property instead.")]
    public void SetCollisionLayer(uint collisionLayer)

    public void SetCollisionLayerBit(int bit, bool value)

Set/clear individual bits on the layer mask. This simplifies editing this Area’s layers.

    [Obsolete("SetCollisionMask is deprecated. Use the CollisionMask property instead.")]
    public void SetCollisionMask(uint collisionMask)

    public void SetCollisionMaskBit(int bit, bool value)

Set/clear individual bits on the collision mask. This simplifies editing which Area layers this Area scans.

    [Obsolete("SetGravity is deprecated. Use the Gravity property instead.")]
    public void SetGravity(float gravity)

Setter for Gravity

    [Obsolete("SetGravityDistanceScale is deprecated. Use the GravityDistanceScale property instead.")]
    public void SetGravityDistanceScale(float distanceScale)

Setter for GravityDistanceScale

    [Obsolete("SetGravityIsPoint is deprecated. Use the GravityPoint property instead.")]
    public void SetGravityIsPoint(bool enable)

Setter for GravityPoint

    [Obsolete("SetGravityVector is deprecated. Use the GravityVec property instead.")]
    public void SetGravityVector(Vector3 vector)

Setter for GravityVec

    [Obsolete("SetLinearDamp is deprecated. Use the LinearDamp property instead.")]
    public void SetLinearDamp(float linearDamp)

Setter for LinearDamp

    [Obsolete("SetMonitorable is deprecated. Use the Monitorable property instead.")]
    public void SetMonitorable(bool enable)

Setter for Monitorable

    [Obsolete("SetMonitoring is deprecated. Use the Monitoring property instead.")]
    public void SetMonitoring(bool enable)

Setter for Monitoring

    [Obsolete("SetPriority is deprecated. Use the Priority property instead.")]
    public void SetPriority(float priority)

Setter for Priority

    [Obsolete("SetReverbAmount is deprecated. Use the ReverbBusAmount property instead.")]
    public void SetReverbAmount(float amount)

Setter for ReverbBusAmount

    [Obsolete("SetReverbBus is deprecated. Use the ReverbBusName property instead.")]
    public void SetReverbBus(string name)

Setter for ReverbBusName

    [Obsolete("SetReverbUniformity is deprecated. Use the ReverbBusUniformity property instead.")]
    public void SetReverbUniformity(float amount)

Setter for ReverbBusUniformity

    [Obsolete("SetSpaceOverrideMode is deprecated. Use the SpaceOverride property instead.")]
    public void SetSpaceOverrideMode(SpaceOverrideEnum enable)

Setter for SpaceOverride

    [Obsolete("SetUseReverbBus is deprecated. Use the ReverbBusEnable property instead.")]
    public void SetUseReverbBus(bool enable)

Setter for ReverbBusEnable

Inner Types

SpaceOverrideEnum

Name Value Description
Disabled 0 This area does not affect gravity/damping.
Combine 1 This area adds its gravity/damping values to whatever has been calculated so far (in [member priority] order).
CombineReplace 2 This area adds its gravity/damping values to whatever has been calculated so far (in [member priority] order), ignoring any lower priority areas.
Replace 3 This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
ReplaceCombine 4 This area replaces any gravity/damping calculated so far (in [member priority] order), but keeps calculating the rest of the areas.
Tags: