Hello im making a slide feature for my game and its working pretty well but i only go in one direction, im trying to have it as you look around and press the slide button you slide in the direction you are facing, here is my script if im doing anything wrong
func doaslide():
if isonfloor():
canslide = true
if Input.isactionpressed("moveforward"):
slidedirection = Vector3(0, 0, -1).normalized() * 200
if Input.is_action_just_pressed("Slide") and can_slide:
velocity = slide_direction
sliding = true
yield(get_tree().create_timer(0.5), "timeout")
sliding = false