diff --git a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs index 893818a3..698d3b59 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs @@ -3,30 +3,26 @@ using System; public class PlayerIdleState : BaseState { - private bool holdItem; - public PlayerIdleState(StateMachine stateMachine, bool hi) : base(stateMachine) + protected PlayerController player; + + public PlayerIdleState(StateMachine stateMachine) : base(stateMachine) { stateName = "Idle State"; - holdItem = hi; } public override void OnEnter() { - //Debug.Log("WALK ENTER"); if (PlayerAnimations.Instance) { - if (!holdItem) + if (!machine.GetScript().playLandedAnimation) { - if (PlayerAnimations.Instance.playerIdleClip) + if (!machine.GetScript().holdItem) { PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); } - } - else - { - if (PlayerAnimations.Instance.playerCarryIdleClip) + else { PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); @@ -34,6 +30,54 @@ public class PlayerIdleState : BaseState PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); } } + else + { + PlayerAnimations.Instance.playerAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerJumpEndClip) + { + if (!machine.GetScript().holdItem) + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + else + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + + machine.GetScript().playLandedAnimation = false; + } + }); + + PlayerAnimations.Instance.BagAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerJumpEndClip) + { + if (!machine.GetScript().holdItem) + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + else + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + } + }); + + PlayerAnimations.Instance.silhoPlayerAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerJumpEndClip) + { + if (!machine.GetScript().holdItem) + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + else + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + } + }); + + PlayerAnimations.Instance.silhoBagAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerJumpEndClip) + { + if (!machine.GetScript().holdItem) + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + else + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + } + }); + } } } public override void update() diff --git a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerJumpState.cs b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerJumpState.cs index 8d5350d7..fe2ee1d0 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerJumpState.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerJumpState.cs @@ -10,6 +10,60 @@ public class PlayerJumpState : BaseState public override void OnEnter() { //Debug.Log("jump"); + if (PlayerAnimations.Instance) + { + if (!machine.GetScript().holdItem && PlayerAnimations.Instance.playerJumpStartClip) + { + PlayerAnimations.Instance.playerAnimator.PlayOneShot(PlayerAnimations.Instance.playerJumpStartClip); + PlayerAnimations.Instance.BagAnimator.PlayOneShot(PlayerAnimations.Instance.playerJumpStartClip); + PlayerAnimations.Instance.silhoPlayerAnimator.PlayOneShot(PlayerAnimations.Instance.playerJumpStartClip); + PlayerAnimations.Instance.silhoBagAnimator.PlayOneShot(PlayerAnimations.Instance.playerJumpStartClip); + + PlayerAnimations.Instance.playerAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerJumpStartClip) + { + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerJumpLoopClip); + } + }); + + PlayerAnimations.Instance.BagAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerJumpStartClip) + { + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerJumpLoopClip); + } + }); + + PlayerAnimations.Instance.silhoPlayerAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerJumpStartClip) + { + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerJumpLoopClip); + } + }); + + PlayerAnimations.Instance.silhoBagAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerJumpStartClip) + { + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerJumpLoopClip); + } + }); + } + else if (machine.GetScript().holdItem && PlayerAnimations.Instance.playerJumpLoopClip) + { + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerJumpLoopClip); + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerJumpLoopClip); + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerJumpLoopClip); + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerJumpLoopClip); + } + else + { + Debug.LogError("missing playercontroller in jump state"); + } + + } } public override void update() { diff --git a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerLandState.cs b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerLandState.cs index 518bab4c..d3a56dbb 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerLandState.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerLandState.cs @@ -9,7 +9,19 @@ public class PlayerLandState : BaseState } public override void OnEnter() { - //Debug.Log("WALK ENTER"); + //Debug.Log("landed ENTER"); + if (PlayerAnimations.Instance) + { + if (!machine.GetScript().holdItem) + { + PlayerAnimations.Instance.playerAnimator.PlayOneShot(PlayerAnimations.Instance.playerJumpEndClip); + PlayerAnimations.Instance.BagAnimator.PlayOneShot(PlayerAnimations.Instance.playerJumpEndClip); + PlayerAnimations.Instance.silhoPlayerAnimator.PlayOneShot(PlayerAnimations.Instance.playerJumpEndClip); + PlayerAnimations.Instance.silhoBagAnimator.PlayOneShot(PlayerAnimations.Instance.playerJumpEndClip); + } + else + machine.GetScript().playLandedAnimation = false; + } } public override void update() { diff --git a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerRunState.cs b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerRunState.cs index 7f30effc..65cb3e6b 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerRunState.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerRunState.cs @@ -14,7 +14,7 @@ public class PlayerRunState : BaseState public override void OnEnter() { //Debug.Log("WALK ENTER"); - if (PlayerAnimations.Instance && PlayerAnimations.Instance.playerRunClip) + if (PlayerAnimations.Instance) { PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerRunClip); PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerRunClip); diff --git a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerWalkState.cs b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerWalkState.cs index c15fb5b1..c4115e28 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerWalkState.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerWalkState.cs @@ -6,37 +6,37 @@ public class PlayerWalkState : BaseState { private float timer; private float delay = 0.5f; - private bool holdItem; - public PlayerWalkState(StateMachine stateMachine, bool hi) : base(stateMachine) + public PlayerWalkState(StateMachine stateMachine) : base(stateMachine) { stateName = "Walk State"; - holdItem = hi; } public override void OnEnter() { //Debug.Log("WALK ENTER"); timer = delay; + + machine.GetScript().playLandedAnimation = false; + if (PlayerAnimations.Instance) { - if (!holdItem) + if (!machine.GetScript().holdItem) { - if (PlayerAnimations.Instance.playerWalkClip) - { - PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerWalkClip); - PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerWalkClip); - PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerWalkClip); - PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerWalkClip); - } + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerWalkClip); } - else + else if (machine.GetScript().holdItem) { - if (PlayerAnimations.Instance.playerCarryWalkClip) - { - PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); - PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); - PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); - PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); - } + + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + } + else + { + Debug.LogError("Missing playercontroller in walk state"); } } } diff --git a/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs b/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs index 79acf136..07fa850c 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs @@ -34,6 +34,13 @@ public class PickAndThrow : Script [Tooltip("Height of ray")] public float rayHeight = 0.1f; + [NonSerialized] + private TweenThread camArmTween; + [NonSerialized] + private TweenThread foodTween; + + public float tweenDuration = 0.3f; + protected override void awake() { pc = GetScript(); @@ -52,6 +59,10 @@ public class PickAndThrow : Script timer = delayTimer; } + + protected override void start() + { + } protected override void update() { if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone) @@ -96,6 +107,7 @@ public class PickAndThrow : Script pc.holdItem = false; inRange = false; throwItem = true; + PlayThrowAnimation(); timer = 0.0f; } @@ -131,6 +143,7 @@ public class PickAndThrow : Script { pc.holdItem = true; RetrieveItemComponets(); + PlayPickUpAnimation(); } } } @@ -273,5 +286,112 @@ public class PickAndThrow : Script return (pc.camArm.Pitch - tpc.pitchUpperClamp) / (tpc.pitchLowerClamp - tpc.pitchUpperClamp); } + private void PlayPickUpAnimation() + { + if (PlayerAnimations.Instance) + { + PlayerAnimations.Instance.playerAnimator.PlayOneShot(PlayerAnimations.Instance.playerPickUpClip); + PlayerAnimations.Instance.playerAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerPickUpClip) + { + if (pc.isMoveKeyPress) + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + else + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + } + }); + + PlayerAnimations.Instance.BagAnimator.PlayOneShot(PlayerAnimations.Instance.playerPickUpClip); + PlayerAnimations.Instance.BagAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerPickUpClip) + { + if (pc.isMoveKeyPress) + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + else + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + } + }); + + PlayerAnimations.Instance.silhoPlayerAnimator.PlayOneShot(PlayerAnimations.Instance.playerPickUpClip); + PlayerAnimations.Instance.silhoPlayerAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerPickUpClip) + { + if (pc.isMoveKeyPress) + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + else + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + } + }); + + PlayerAnimations.Instance.silhoBagAnimator.PlayOneShot(PlayerAnimations.Instance.playerPickUpClip); + PlayerAnimations.Instance.silhoBagAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerPickUpClip) + { + if (pc.isMoveKeyPress) + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + else + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + } + }); + } + } + + private void PlayThrowAnimation() + { + if (PlayerAnimations.Instance) + { + PlayerAnimations.Instance.playerAnimator.PlayOneShot(PlayerAnimations.Instance.playerThrowClip); + PlayerAnimations.Instance.playerAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerThrowClip) + { + if (pc.isMoveKeyPress) + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + else + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + } + }); + + PlayerAnimations.Instance.BagAnimator.PlayOneShot(PlayerAnimations.Instance.playerPickUpClip); + PlayerAnimations.Instance.BagAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerThrowClip) + { + if (pc.isMoveKeyPress) + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + else + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + } + }); + + PlayerAnimations.Instance.silhoPlayerAnimator.PlayOneShot(PlayerAnimations.Instance.playerPickUpClip); + PlayerAnimations.Instance.silhoPlayerAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerThrowClip) + { + if (pc.isMoveKeyPress) + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + else + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + } + }); + + PlayerAnimations.Instance.silhoBagAnimator.PlayOneShot(PlayerAnimations.Instance.playerPickUpClip); + PlayerAnimations.Instance.silhoBagAnimator.OnClipFinished.RegisterAction((x) => + { + if (x.FinishedClip == PlayerAnimations.Instance.playerThrowClip) + { + if (pc.isMoveKeyPress) + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + else + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + } + }); + } + } } \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs index 2bda8938..d8b092a3 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs @@ -7,17 +7,17 @@ public class PlayerAnimations : Script { #region Raccoon [SerializeField] - public AnimationClipAsset playerIdleClip; // done + public AnimationClipAsset playerIdleClip; [SerializeField] - public AnimationClipAsset playerWalkClip; // done + public AnimationClipAsset playerWalkClip; [SerializeField] - public AnimationClipAsset playerRunClip; // done + public AnimationClipAsset playerRunClip; [SerializeField] public AnimationClipAsset playerPickUpClip; [SerializeField] - public AnimationClipAsset playerCarryIdleClip; // done + public AnimationClipAsset playerCarryIdleClip; [SerializeField] - public AnimationClipAsset playerCarryWalkClip; // done + public AnimationClipAsset playerCarryWalkClip; [SerializeField] public AnimationClipAsset playerThrowClip; [SerializeField] @@ -72,6 +72,37 @@ public class PlayerAnimations : Script if (!silhoBagAnimator) Debug.LogError("Silho Player Animator is MISSING!"); + + if(!playerIdleClip) + Debug.LogError("Idle clip is MISSING!"); + + if (!playerWalkClip) + Debug.LogError("run clip is MISSING!"); + + if (!playerPickUpClip) + Debug.LogError("Pickup clip is MISSING!"); + + if (!playerThrowClip) + Debug.LogError("Throw clip is MISSING!"); + + if (!playerJumpStartClip) + Debug.LogError("Jump start clip is MISSING!"); + + if (!playerJumpLoopClip) + Debug.LogError("Jump loop clip is MISSING!"); + + if (!playerJumpEndClip) + Debug.LogError("Jump end clip is MISSING!"); + + if (!playerCarryIdleClip) + Debug.LogError("Carry idle clip is MISSING!"); + + if (!playerCarryWalkClip) + Debug.LogError("Carry walk clip is MISSING!"); + + if (!playerRunClip) + Debug.LogError("Run clip is MISSING!"); + } protected override void onDestroy() diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs index 9bac991b..3e93c663 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs @@ -83,6 +83,8 @@ public class PlayerController : Script public GameObject silhouetteBag; private Renderable silhouetteBagRend; + public bool playLandedAnimation { get; set; } + protected override void awake() { //default setup @@ -108,8 +110,8 @@ public class PlayerController : Script stateMachine = AddScript(); Dictionary dictionary = new Dictionary(); - dictionary.Add(typeof(PlayerIdleState), new PlayerIdleState(stateMachine, holdItem)); - dictionary.Add(typeof(PlayerWalkState), new PlayerWalkState(stateMachine, holdItem)); + dictionary.Add(typeof(PlayerIdleState), new PlayerIdleState(stateMachine)); + dictionary.Add(typeof(PlayerWalkState), new PlayerWalkState(stateMachine)); dictionary.Add(typeof(PlayerRunState), new PlayerRunState(stateMachine)); dictionary.Add(typeof(PlayerJumpState), new PlayerJumpState(stateMachine)); dictionary.Add(typeof(PlayerFallState), new PlayerFallState(stateMachine)); @@ -134,6 +136,8 @@ public class PlayerController : Script } AudioHandler.audioClipHandlers["footsteps"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_footsteps"); + + playLandedAnimation = false; } protected override void start() @@ -189,6 +193,7 @@ public class PlayerController : Script MoveKey(); Sprint(); Jump(); + //Debug.Log($"{currentState}"); //Debug.Log($" axisX: {axisMove.x} axisY:{axisMove.y}"); //Debug.Log($"X: {rb.LinearVelocity.x}" + $" Z: {rb.LinearVelocity.z}"); @@ -305,12 +310,18 @@ public class PlayerController : Script if (Input.GetKeyUp(Input.KeyCode.LeftShift)) { - if (isMoveKeyPress) - { + if (isMoveKeyPress && isGrounded) + { currentState = RaccoonStates.WALKING; - if(stateMachine && !stateMachine.IsState(typeof(PlayerWalkState))) + if (stateMachine && !stateMachine.IsState(typeof(PlayerWalkState))) stateMachine.SetState(typeof(PlayerWalkState)); } + else if(!isMoveKeyPress && isGrounded) + { + currentState = RaccoonStates.IDLE; + if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState))) + stateMachine.SetState(typeof(PlayerIdleState)); + } sprintIncreaseOnce = false; moveForce = oldForce; maxMoveVel = maxOldVel; @@ -323,6 +334,7 @@ public class PlayerController : Script { if ( (Input.GetKeyDown(Input.KeyCode.Space) || landedOnJumpPad ) && isGrounded && rb != null) { + isGrounded = false; currentState = RaccoonStates.JUMP; if (stateMachine && !stateMachine.IsState(typeof(PlayerJumpState))) stateMachine.SetState(typeof(PlayerJumpState)); @@ -386,6 +398,7 @@ public class PlayerController : Script if (currentState == RaccoonStates.FALLING) { currentState = RaccoonStates.LANDED; + playLandedAnimation = true; if (stateMachine && !stateMachine.IsState(typeof(PlayerLandState))) stateMachine.SetState(typeof(PlayerLandState)); }