Static body for 2D physics.
    public class StaticBody2D : PhysicsBody2D

Static body for 2D physics. A StaticBody2D is a body that is not intended to move. It is ideal for implementing objects in the environment, such as walls or platforms.

Additionally, a constant linear or angular velocity can be set for the static body, which will affect colliding bodies as if it were moving (for example, a conveyor belt).

Inheritance Chain

Constructors

    public StaticBody2D()

Properties

    public float Bounce { get; set; }

The body’s bounciness. Values range from 0 (no bounce) to 1 (full bounciness).

Deprecated, use PhysicsMaterial.Bounce instead via PhysicsMaterialOverride.

    public float ConstantAngularVelocity { get; set; }

The body’s constant angular velocity. This does not rotate the body, but affects colliding bodies, as if it were rotating.

    public Vector2 ConstantLinearVelocity { get; set; }

The body’s constant linear velocity. This does not move the body, but affects colliding bodies, as if it were moving.

    public float Friction { get; set; }

The body’s friction. Values range from 0 (no friction) to 1 (full friction).

Deprecated, use PhysicsMaterial.Friction instead via PhysicsMaterialOverride.

    public PhysicsMaterial PhysicsMaterialOverride { get; set; }

Methods

    [Obsolete("GetBounce is deprecated. Use the Bounce property instead.")]
    public float GetBounce()

Getter for Bounce

    [Obsolete("GetConstantAngularVelocity is deprecated. Use the ConstantAngularVelocity property instead.")]
    public float GetConstantAngularVelocity()

Getter for ConstantAngularVelocity

    [Obsolete("GetConstantLinearVelocity is deprecated. Use the ConstantLinearVelocity property instead.")]
    public Vector2 GetConstantLinearVelocity()

Getter for ConstantLinearVelocity

    [Obsolete("GetFriction is deprecated. Use the Friction property instead.")]
    public float GetFriction()

Getter for Friction

    [Obsolete("GetPhysicsMaterialOverride is deprecated. Use the PhysicsMaterialOverride property instead.")]
    public PhysicsMaterial GetPhysicsMaterialOverride()

Getter for PhysicsMaterialOverride

    [Obsolete("SetBounce is deprecated. Use the Bounce property instead.")]
    public void SetBounce(float bounce)

Setter for Bounce

    [Obsolete("SetConstantAngularVelocity is deprecated. Use the ConstantAngularVelocity property instead.")]
    public void SetConstantAngularVelocity(float vel)

Setter for ConstantAngularVelocity

    [Obsolete("SetConstantLinearVelocity is deprecated. Use the ConstantLinearVelocity property instead.")]
    public void SetConstantLinearVelocity(Vector2 vel)

Setter for ConstantLinearVelocity

    [Obsolete("SetFriction is deprecated. Use the Friction property instead.")]
    public void SetFriction(float friction)

Setter for Friction

    [Obsolete("SetPhysicsMaterialOverride is deprecated. Use the PhysicsMaterialOverride property instead.")]
    public void SetPhysicsMaterialOverride(PhysicsMaterial physicsMaterialOverride)

Setter for PhysicsMaterialOverride

Tags: