SkeletonIK3D
A node used to rotate all bones of a Skeleton3D bone chain a way that places the end bone at a desired 3D position.
A node used to rotate all bones of a Skeleton3D bone chain a way that places the end bone at a desired 3D position.
SkeletonIK3D is used to rotate all bones of a Skeleton3D bone chain a way that places the end bone at a desired 3D position. A typical scenario for IK in games is to place a character's feet on the ground or a character's hands on a currently held object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the Skeleton3D bones_global_pose_override property for all affected bones in the chain. If fully applied, this overwrites any bone transform from Animations or bone custom poses set by users. The applied amount can be controlled with the SkeletonModifier3D.Influence property.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
SkeletonIK3DConstructor
public SkeletonIK3D();Properties10
InterpolationProperty · Deprecated
public float Interpolation { get; set; }Interpolation value for how much the IK results are applied to the current skeleton bone chain. A value of 1.0 will overwrite all skeleton bone transforms completely while a value of 0.0 will visually disable the SkeletonIK.
MagnetProperty
public Vector3 Magnet { get; set; }Secondary target position (first is SkeletonIK3D.Target property or target_node) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position.
MaxIterationsProperty
public int MaxIterations { get; set; }Number of iteration loops used by the IK solver to produce more accurate (and elegant) bone chain results.
MinDistanceProperty
public float MinDistance { get; set; }The minimum distance between bone and goal target. If the distance is below this value, the IK solver stops further iterations.
OverrideTipBasisProperty
public bool OverrideTipBasis { get; set; }If true overwrites the rotation of the tip bone with the rotation of the SkeletonIK3D.Target (or target_node if defined).
RootBoneProperty
public StringName RootBone { get; set; }The name of the current root bone, the first bone in the IK chain.
TargetProperty
public Transform3D Target { get; set; }The first target of the IK chain where the tip bone is placed and, if SkeletonIK3D.OverrideTipBasis is true, how the tip bone is rotated. If target_node points to a valid node, that node's transform is used instead and this property is ignored.
TargetEntityProperty
public EntityPath TargetEntity { get; set; }Target node EntityPath for the IK chain. If available, the node's current Transform3D is used instead of the SkeletonIK3D.Target property.
TipBoneProperty
public StringName TipBone { get; set; }The name of the current tip bone, the last bone in the IK chain placed at the SkeletonIK3D.Target transform (or target_node if defined).
UseMagnetProperty
public bool UseMagnet { get; set; }If true, instructs the IK solver to consider the secondary magnet target (pole target) when calculating the bone chain. Use the magnet position (pole target) to control the bending of the IK chain.
Methods24
GetInterpolationfloat
public float GetInterpolation();floatGetMagnetPositionVector3
public Vector3 GetMagnetPosition();Vector3GetMaxIterationsint
public int GetMaxIterations();intGetMinDistancefloat
public float GetMinDistance();floatGetParentSkeletonSkeleton3D
public Skeleton3D GetParentSkeleton();Returns the parent Skeleton3D node that was present when SkeletonIK entered the scene tree. Returns null if the parent node was not a Skeleton3D node when SkeletonIK3D entered the scene tree.
Skeleton3DGetRootBoneStringName
public StringName GetRootBone();StringNameGetTargetEntityEntityPath
public EntityPath GetTargetEntity();EntityPathGetTargetTransformTransform3D
public Transform3D GetTargetTransform();Transform3DGetTipBoneStringName
public StringName GetTipBone();StringNameIsOverrideTipBasisbool
public bool IsOverrideTipBasis();boolIsRunningbool
public bool IsRunning();Returns true if SkeletonIK is applying IK effects on continues frames to the Skeleton3D bones. Returns false if SkeletonIK is stopped or SkeletonIK3D.Start was used with the one_time parameter set to true.
boolIsUsingMagnetbool
public bool IsUsingMagnet();boolSetInterpolationvoid
public void SetInterpolation(float interpolation);| Name | Type | Default |
|---|---|---|
interpolation | float | — |
SetMagnetPositionvoid
public void SetMagnetPosition(Vector3 localPosition);| Name | Type | Default |
|---|---|---|
localPosition | Vector3 | — |
SetMaxIterationsvoid
public void SetMaxIterations(int iterations);| Name | Type | Default |
|---|---|---|
iterations | int | — |
SetMinDistancevoid
public void SetMinDistance(float minDistance);| Name | Type | Default |
|---|---|---|
minDistance | float | — |
SetOverrideTipBasisvoid
public void SetOverrideTipBasis(bool @override);| Name | Type | Default |
|---|---|---|
override | bool | — |
SetRootBonevoid
public void SetRootBone(StringName rootBone);| Name | Type | Default |
|---|---|---|
rootBone | StringName | — |
SetTargetEntityvoid
public void SetTargetEntity(EntityPath node);| Name | Type | Default |
|---|---|---|
node | EntityPath | — |
SetTargetTransformvoid
public void SetTargetTransform(Transform3D target);| Name | Type | Default |
|---|---|---|
target | Transform3D | — |
SetTipBonevoid
public void SetTipBone(StringName tipBone);| Name | Type | Default |
|---|---|---|
tipBone | StringName | — |
SetUseMagnetvoid
public void SetUseMagnet(bool use);| Name | Type | Default |
|---|---|---|
use | bool | — |
Startvoid
public void Start(bool oneTime = false);Starts applying IK effects on each frame to the Skeleton3D bones but will only take effect starting on the next frame. If one_time is true, this will take effect immediately but also reset on the next frame.
| Name | Type | Default |
|---|---|---|
oneTime | bool | false |
Stopvoid
public void Stop();Stops applying IK effects on each frame to the Skeleton3D bones and also calls Skeleton3D.ClearBonesGlobalPoseOverride to remove existing overrides on all bones.