Newbie with Godot. Error with following a tutorial

I’m new to Godot, and I’m trying to follow a tutorial. I get this error, any idea how to solve it?

it should work after you unindent the func and var

Try this

var speed = 10
var gravity = -9.8
var velocity = Vector3()


func _ready():
    pass

func _physics_process(delta):
    var move_direction = Vector3()
    
    if Input.is_action_pressed("move_forward"):
        move_direction.z -= 1
    if Input.is_action_pressed("move_backward"):
        move_direction.z += 1
    if Input.is_action_pressed("move_left"):
        move_direction.x -= 1
    if Input.is_action_pressed("move_right"):
        move_direction.x += 1

    move_direction = move_direction.normalized()

    velocity.x = move_direction.x * speed
    velocity.z = move_direction.z * speed

    velocity.y += gravity * delta

    velocity = move_and_slide(velocity, Vector3.UP)

As for why you’re experiencing this issue, your indentation is wrong. The function declaration is indented with one tab, meaning everything in that block should be indented by more than one tab.

However, your if statements are also indented by only one tab, meaning they are outside of the scope of the function block.

Dedent your function declaration func _process(delta) by one tab so that it is not indented at all, then ensure any lines that follow that are supposed to be within the scope of the function have more indents, and therefore are inside scope.

I hope this helps to resolve your issue.

Regards,