SkeletonModification2DJiggle

Inherits: SkeletonModification2D < Resource < RefCounted < Object

A modification that jiggles Bone2D nodes as they move towards a target.

Description

This modification moves a series of bones, typically called a bone chain, towards a target. What makes this modification special is that it calculates the velocity and acceleration for each bone in the bone chain, and runs a very light physics-like calculation using the inputted values. This allows the bones to overshoot the target and "jiggle" around. It can be configured to act more like a spring, or sway around like cloth might.

This modification is useful for adding additional motion to things like hair, the edges of clothing, and more. It has several settings to that allow control over how the joint moves when the target moves.

Note: The Jiggle modifier has jiggle_joints, which are the data objects that hold the data for each joint in the Jiggle chain. This is different from than Bone2D nodes! Jiggle joints hold the data needed for each Bone2D in the bone chain used by the Jiggle modification.

Properties

float

damping

0.75

Vector2

gravity

Vector2(0, 6)

int

jiggle_data_chain_length

0

float

mass

0.75

float

stiffness

3.0

NodePath

target_nodepath

NodePath("")

bool

use_gravity

false

Methods

int

get_collision_mask ( ) const

NodePath

get_jiggle_joint_bone2d_node ( int joint_idx ) const

int

get_jiggle_joint_bone_index ( int joint_idx ) const

float

get_jiggle_joint_damping ( int joint_idx ) const

Vector2

get_jiggle_joint_gravity ( int joint_idx ) const

float

get_jiggle_joint_mass ( int joint_idx ) const

bool

get_jiggle_joint_override ( int joint_idx ) const

float

get_jiggle_joint_stiffness ( int joint_idx ) const

bool

get_jiggle_joint_use_gravity ( int joint_idx ) const

bool

get_use_colliders ( ) const

void

set_collision_mask ( int collision_mask )

void

set_jiggle_joint_bone2d_node ( int joint_idx, NodePath bone2d_node )

void

set_jiggle_joint_bone_index ( int joint_idx, int bone_idx )

void

set_jiggle_joint_damping ( int joint_idx, float damping )

void

set_jiggle_joint_gravity ( int joint_idx, Vector2 gravity )

void

set_jiggle_joint_mass ( int joint_idx, float mass )

void

set_jiggle_joint_override ( int joint_idx, bool override )

void

set_jiggle_joint_stiffness ( int joint_idx, float stiffness )

void

set_jiggle_joint_use_gravity ( int joint_idx, bool use_gravity )

void

set_use_colliders ( bool use_colliders )


Property Descriptions