Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

SkeletonModification2DPhysicalBones

Inherits: SkeletonModification2D < Resource < RefCounted < Object

A modification that applies the transforms of PhysicalBone2D nodes to Bone2D nodes.

Description

This modification takes the transforms of PhysicalBone2D nodes and applies them to Bone2D nodes. This allows the Bone2D nodes to react to physics thanks to the linked PhysicalBone2D nodes.

Experimental. Physical bones may be changed in the future to perform the position update of Bone2D on their own.

Properties

int

physical_bone_chain_length

0

Methods

void

fetch_physical_bones ( )

NodePath

get_physical_bone_node ( int joint_idx ) const

void

set_physical_bone_node ( int joint_idx, NodePath physicalbone2d_node )

void

start_simulation ( StringName[] bones=[] )

void

stop_simulation ( StringName[] bones=[] )


Property Descriptions

int physical_bone_chain_length = 0

  • void set_physical_bone_chain_length ( int value )

  • int get_physical_bone_chain_length ( )

The number of PhysicalBone2D nodes linked in this modification.


Method Descriptions

void fetch_physical_bones ( )

Empties the list of PhysicalBone2D nodes and populates it with all PhysicalBone2D nodes that are children of the Skeleton2D.


NodePath get_physical_bone_node ( int joint_idx ) const

Returns the PhysicalBone2D node at joint_idx.


void set_physical_bone_node (