Class SkeletonModification2DLookAt
- Namespace
- Godot
- Assembly
- GodotSharp.dll
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.
public class SkeletonModification2DLookAt : SkeletonModification2D, IDisposable
- Inheritance
-
SkeletonModification2DLookAt
- Implements
- Inherited Members
Constructors
SkeletonModification2DLookAt()
public SkeletonModification2DLookAt()
Properties
Bone2DNode
The Bone2D node that the modification will operate on.
public NodePath Bone2DNode { get; set; }
Property Value
BoneIndex
The index of the Bone2D node that the modification will operate on.
public int BoneIndex { get; set; }
Property Value
TargetNodePath
The NodePath to the node that is the target for the LookAt modification. This node is what the modification will rotate the Bone2D to.
public NodePath TargetNodePath { get; set; }
Property Value
Methods
GetAdditionalRotation()
Returns the amount of additional rotation that is applied after the LookAt modification executes.
public float GetAdditionalRotation()
Returns
GetConstraintAngleInvert()
Returns whether the constraints to this modification are inverted or not.
public bool GetConstraintAngleInvert()
Returns
GetConstraintAngleMax()
Returns the constraint's maximum allowed angle.
public float GetConstraintAngleMax()
Returns
GetConstraintAngleMin()
Returns the constraint's minimum allowed angle.
public float GetConstraintAngleMin()
Returns
GetEnableConstraint()
Returns true
if the LookAt modification is using constraints.
public bool GetEnableConstraint()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
SetAdditionalRotation(float)
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.
public void SetAdditionalRotation(float rotation)
Parameters
rotation
float
SetConstraintAngleInvert(bool)
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.
public void SetConstraintAngleInvert(bool invert)
Parameters
invert
bool
SetConstraintAngleMax(float)
Sets the constraint's maximum allowed angle.
public void SetConstraintAngleMax(float angleMax)
Parameters
angleMax
float
SetConstraintAngleMin(float)
Sets the constraint's minimum allowed angle.
public void SetConstraintAngleMin(float angleMin)
Parameters
angleMin
float
SetEnableConstraint(bool)
Sets whether this modification will use constraints or not. When true
, constraints will be applied when solving the LookAt modification.
public void SetEnableConstraint(bool enableConstraint)
Parameters
enableConstraint
bool