Class reference

SkeletonModification2DPhysicalBones

Inherits SkeletonModification2D

Experimental.

Physical bones may be changed in the future to perform the position update of Bone2D on their own, without needing this resource.

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.

Properties

int physical_bone_chain_length = 0

The number of PhysicalBone2D nodes linked in this modification.

Methods

void set_physical_bone_node(int joint_idx, NodePath physicalbone2d_node)

Sets the PhysicalBone2D node at joint_idx. Note: This is just the index used for this modification, not the bone index used in the Skeleton2D.

void start_simulation(StringName[] bones = [])

Tell the PhysicalBone2D nodes to start simulating and interacting with the physics world. Optionally, an array of bone names can be passed to this function, and that will cause only PhysicalBone2D nodes with those names to start simulating.

void stop_simulation(StringName[] bones = [])

Tell the PhysicalBone2D nodes to stop simulating and interacting with the physics world. Optionally, an array of bone names can be passed to this function, and that will cause only PhysicalBone2D nodes with those names to stop simulating.

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.