fixed camera and sword animation issue and upgraded to Godot 4.6
This commit is contained in:
@@ -101,6 +101,8 @@ public partial class HeadSystem : Node3D
|
||||
|
||||
public void Init()
|
||||
{
|
||||
_isPlayingForcingAnim = false;
|
||||
|
||||
Input.SetMouseMode(Input.MouseModeEnum.Captured);
|
||||
_camera = GetNode<Camera3D>("CameraSmooth/Camera3D");
|
||||
_cameraAnchor = GetNode<Marker3D>("CameraAnchor");
|
||||
@@ -133,6 +135,7 @@ public partial class HeadSystem : Node3D
|
||||
}
|
||||
public void OnStartDeathAnimation()
|
||||
{
|
||||
_isPlayingForcingAnim = true;
|
||||
_animationTree.Set("parameters/OnDie/request", (int) AnimationNodeOneShot.OneShotRequest.Fire);
|
||||
}
|
||||
|
||||
@@ -160,9 +163,17 @@ public partial class HeadSystem : Node3D
|
||||
}
|
||||
|
||||
private bool _footstepEmitted;
|
||||
private bool _isPlayingForcingAnim;
|
||||
|
||||
public void LookAround(CameraParameters inputs)
|
||||
{
|
||||
if (_isPlayingForcingAnim)
|
||||
{
|
||||
_camera.Position = Vector3.Zero;
|
||||
_camera.Rotation = Vector3.Zero;
|
||||
return;
|
||||
}
|
||||
|
||||
var (delta,
|
||||
lookDir,
|
||||
playerInput,
|
||||
|
||||
Reference in New Issue
Block a user