SkeletonModification2DLookAt
A modification that rotates a Bone2D node to look at a target.
A modification that rotates a Bone2D node to look at a target.
This SkeletonModification2D rotates a bone to look a target. This is extremely helpful for moving character's head to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
SkeletonModification2DLookAtConstructor
public SkeletonModification2DLookAt();Properties3
Bone2DEntityProperty
public EntityPath Bone2DEntity { get; set; }The Bone2D node that the modification will operate on.
BoneIndexProperty
public int BoneIndex { get; set; }The index of the Bone2D node that the modification will operate on.
TargetEntitypathProperty
public EntityPath TargetEntitypath { get; set; }The EntityPath to the node that is the target for the LookAt modification. This node is what the modification will rotate the Bone2D to.
Methods16
GetAdditionalRotationfloat
public float GetAdditionalRotation();Returns the amount of additional rotation that is applied after the LookAt modification executes.
floatGetBone2DEntityEntityPath
public EntityPath GetBone2DEntity();EntityPathGetBoneIndexint
public int GetBoneIndex();intGetConstraintAngleInvertbool
public bool GetConstraintAngleInvert();Returns whether the constraints to this modification are inverted or not.
boolGetConstraintAngleMaxfloat
public float GetConstraintAngleMax();Returns the constraint's maximum allowed angle.
floatGetConstraintAngleMinfloat
public float GetConstraintAngleMin();Returns the constraint's minimum allowed angle.
floatGetEnableConstraintbool
public bool GetEnableConstraint();Returns true if the LookAt modification is using constraints.
boolGetTargetEntityEntityPath
public EntityPath GetTargetEntity();EntityPathSetAdditionalRotationvoid
public void SetAdditionalRotation(float rotation);Sets the amount of additional rotation that is to be applied after executing the modification. This allows for offsetting the results by the inputted rotation amount.
| Name | Type | Default |
|---|---|---|
rotation | float | — |
SetBone2DEntityvoid
public void SetBone2DEntity(EntityPath bone2DEntitypath);| Name | Type | Default |
|---|---|---|
bone2DEntitypath | EntityPath | — |
SetBoneIndexvoid
public void SetBoneIndex(int boneIdx);| Name | Type | Default |
|---|---|---|
boneIdx | int | — |
SetConstraintAngleInvertvoid
public void SetConstraintAngleInvert(bool invert);When true, the modification will use an inverted joint constraint.
An inverted joint constraint only constraints the Bone2D to the angles outside of the inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint constraint, as it constraints the joint to the outside of the inputted values.
| Name | Type | Default |
|---|---|---|
invert | bool | — |
SetConstraintAngleMaxvoid
public void SetConstraintAngleMax(float angleMax);Sets the constraint's maximum allowed angle.
| Name | Type | Default |
|---|---|---|
angleMax | float | — |
SetConstraintAngleMinvoid
public void SetConstraintAngleMin(float angleMin);Sets the constraint's minimum allowed angle.
| Name | Type | Default |
|---|---|---|
angleMin | float | — |
SetEnableConstraintvoid
public void SetEnableConstraint(bool enableConstraint);Sets whether this modification will use constraints or not. When true, constraints will be applied when solving the LookAt modification.
| Name | Type | Default |
|---|---|---|
enableConstraint | bool | — |
SetTargetEntityvoid
public void SetTargetEntity(EntityPath targetEntitypath);| Name | Type | Default |
|---|---|---|
targetEntitypath | EntityPath | — |