im new to godot just started learning , i tried to make a movement for the player but the scrips always runs the last if statlment ignoring the rest before
this is the scritp i had
extends KinematicBody2D
export(int) var speed = 100
var movement_direction := Vector2.ZERO
func _process(delta):
if Input.is_action_pressed("right"):
movement_direction.x=1
if Input.is_action_pressed("left"):
movement_direction.x=-1
movement_direction = movement_direction.normalized()
move_and_slide(movement_direction*speed)