Table of Contents

Class PhysicalBone2D

Namespace
Godot
Assembly
GodotSharp.dll

The PhysicalBone2D node is a RigidBody2D-based node that can be used to make Bone2Ds in a Skeleton2D react to physics.

Note: To make the Bone2Ds visually follow the PhysicalBone2D node, use a SkeletonModification2DPhysicalBones modification on the Skeleton2D parent.

Note: The PhysicalBone2D node does not automatically create a Joint2D node to keep PhysicalBone2D nodes together. They must be created manually. For most cases, you want to use a PinJoint2D node. The PhysicalBone2D node will automatically configure the Joint2D node once it's been added as a child node.

public class PhysicalBone2D : RigidBody2D, IDisposable
Inheritance
PhysicalBone2D
Implements
Inherited Members

Constructors

PhysicalBone2D()

public PhysicalBone2D()

Properties

AutoConfigureJoint

If true, the PhysicalBone2D will automatically configure the first Joint2D child node. The automatic configuration is limited to setting up the node properties and positioning the Joint2D.

public bool AutoConfigureJoint { get; set; }

Property Value

bool

Bone2DIndex

The index of the Bone2D that this PhysicalBone2D should simulate.

public int Bone2DIndex { get; set; }

Property Value

int

Bone2DNodePath

The NodePath to the Bone2D that this PhysicalBone2D should simulate.

public NodePath Bone2DNodePath { get; set; }

Property Value

NodePath

FollowBoneWhenSimulating

If true, the PhysicalBone2D will keep the transform of the bone it is bound to when simulating physics.

public bool FollowBoneWhenSimulating { get; set; }

Property Value

bool

SimulatePhysics

If true, the PhysicalBone2D will start simulating using physics. If false, the PhysicalBone2D will follow the transform of the Bone2D node.

Note: To have the Bone2Ds visually follow the PhysicalBone2D, use a SkeletonModification2DPhysicalBones modification on the Skeleton2D node with the Bone2D nodes.

public bool SimulatePhysics { get; set; }

Property Value

bool

Methods

GetJoint()

Returns the first Joint2D child node, if one exists. This is mainly a helper function to make it easier to get the Joint2D that the PhysicalBone2D is autoconfiguring.

public Joint2D GetJoint()

Returns

Joint2D

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

IsSimulatingPhysics()

Returns a boolean that indicates whether the PhysicalBone2D is running and simulating using the Godot 2D physics engine. When true, the PhysicalBone2D node is using physics.

public bool IsSimulatingPhysics()

Returns

bool