godot 4
class_name Dashstate
extends Player_State
#-------------------------------------------
@export var fall_state : Player_State
@export var ground_state : Player_State
@export var run_animation_node : String = "Run"
@export var fall_animation_node : String = "Fall"
#-------------------------------------------
@onready var timer : Timer = $Timer
#-------------------------------------------
const dash_speed = 1
#-------------------------------------------
var dashing : bool = false
#-------------------------------------------
func state_process(delta):
timer.start()
dashing = true
#var direction = Input.get_vector("ui_left", "ui_right","ui_up","ui_down")
#character.velocity.x = direction.x * dash_speed
if (timer.is_stopped() == true and character.is_on_floor()):
dashing = false
playback.travel(run_animation_node)
next_state = ground_state
elif(timer.is_stopped() == true and character.is_on_floor() == false):
dashing = false
playback.travel(fall_animation_node)
next_state = fall_state
#-------------------------------------------
Timer is set at 0,2 seconds and oneshot == true
Is this even possible? When I try to make a dash it seems to be overwritten by the player movement logic. Is there any way to fix this?
any help is greatly appreciated, thank you in advance