How could I fix this because he would move and stop while Im still holding down a key.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Waffles

extends KinematicBody2D

var v = Vector2(0,0)

func _physics_process(_delta):
if Input.is_action_just_pressed(“right”):
v.x = 100
if Input.is_action_just_pressed(“left”):
v.x = -100

move_and_slide(v)

v.x = lerp(v.x,0,0.1)
:bust_in_silhouette: Reply From: kidscancode

Use is_action_pressed() instead of is_action_just_pressed(). The latter only triggers once per key press.

Thank you very much for the response, it worked!

Waffles | 2021-02-17 16:56