now that's an animation
This commit is contained in:
@@ -21,6 +21,7 @@ public partial class HeadSystem : Node3D
|
||||
private Camera3D _camera;
|
||||
private Marker3D _cameraAnchor;
|
||||
private AnimationPlayer _animationPlayer;
|
||||
private AnimationTree _animationTree;
|
||||
|
||||
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||
public float LookSensitivity { get; set; } = 1f;
|
||||
@@ -88,6 +89,7 @@ public partial class HeadSystem : Node3D
|
||||
_camera = GetNode<Camera3D>("CameraSmooth/Camera3D");
|
||||
_cameraAnchor = GetNode<Marker3D>("CameraAnchor");
|
||||
_animationPlayer = GetNode<AnimationPlayer>("AnimationPlayer");
|
||||
_animationTree = GetNode<AnimationTree>("AnimationTree");
|
||||
|
||||
_fpRig = GetNode<Node3D>("FPRig");
|
||||
_fpDisplacedRig = GetNode<Node3D>("FPRig/Sword");
|
||||
@@ -101,6 +103,21 @@ public partial class HeadSystem : Node3D
|
||||
{
|
||||
_animationPlayer.Play("mantle");
|
||||
}
|
||||
|
||||
public void OnHit()
|
||||
{
|
||||
_animationTree.Set("parameters/OnHit/request", (int) AnimationNodeOneShot.OneShotRequest.Fire);
|
||||
}
|
||||
|
||||
public void OnHitboxActivated()
|
||||
{
|
||||
GD.Print("Hitbox activated");
|
||||
}
|
||||
|
||||
public void OnHitboxDeactivated()
|
||||
{
|
||||
GD.Print("Hitbox deactivated");
|
||||
}
|
||||
|
||||
public void LookAround(CameraParameters inputs)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user