Hi, everyone. I was making a Horror game (this is actually my first game), I already implemented the movement, but I was having so much trouble on adding a run mechanic where you make the player character run.

I wanted to do it the way the old Resident Evil games did when they had tank controls. Like for example, your character is walking by moving him, but to run you press an action button to make the character run. I'm actually making the game in 2D by the way.
Can someone help me?

    change the Speed when "move_run" is pressed or not

    VampirePrince I am actually making a horror game too. You need a conditional that determines whether you run or not and a different speed for your player to use. So add something like this:

    export var RUNSPEED = 300
    export var RUNACCELERATION = 2
    var isRunning = false

    and then have a function to listen to each frame for running:

    func _RunningMode():
    if Input.is_action_pressed('run'):
         _isRunning = true
    else:
         _isRunning = false

    and we listen for that function each frame.
    then to your _physics process(delta) function after the 'input_vector' line we change the movement speed.

    func _physics_process(delta):
        _RunningMode()
    
        var  move_direction := input_vector.normalized()
        if isRunning == true:
            move_and_slide(RUNSPEED * move_direction)
        else:
            move_and_slide(SPEED * move_direction)