DungeonRPG/Scripts/Characters/Player3D/Player3DIdleState.cs

32 lines
746 B
C#

using Godot;
using System;
using DungeonRPG.Scripts.General;
public partial class Player3DIdleState : PlayerState3D
{
public override void _PhysicsProcess(double delta)
{
if (characterNode.Direction != Vector2.Zero)
{
GD.Print("moving");
characterNode.StateMachine.SwitchState<Player3DMoveState>();
}
}
public override void _Input(InputEvent @event)
{
if (Input.IsActionJustPressed(GameConstants.INPUT_DASH))
{
characterNode.StateMachine.SwitchState<Player3DDashState>();
}
}
protected override void EnterState()
{
base.EnterState();
characterNode.AnimationPlayer.Play("idle", customBlend: 0.3f);
}
}