Table of Contents

Class StaticBody2D

Namespace
Godot
Assembly
GodotSharp.dll

A static 2D physics body. It can't be moved by external forces or contacts, but can be moved manually by other means such as code, AnimationMixers (with CallbackModeProcess set to Physics), and RemoteTransform2D.

When StaticBody2D is moved, it is teleported to its new position without affecting other physics bodies in its path. If this is not desired, use AnimatableBody2D instead.

StaticBody2D is useful for completely static objects like floors and walls, as well as moving surfaces like conveyor belts and circular revolving platforms (by using ConstantLinearVelocity and ConstantAngularVelocity).

public class StaticBody2D : PhysicsBody2D, IDisposable
Inheritance
StaticBody2D
Implements
Derived
Inherited Members

Constructors

StaticBody2D()

public StaticBody2D()

Properties

ConstantAngularVelocity

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

public float ConstantAngularVelocity { get; set; }

Property Value

float

ConstantLinearVelocity

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

public Vector2 ConstantLinearVelocity { get; set; }

Property Value

Vector2

PhysicsMaterialOverride

The physics material override for the body.

If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.

public PhysicsMaterial PhysicsMaterialOverride { get; set; }

Property Value

PhysicsMaterial

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool