What Godot version does this guy use or how to fix it in godot 4 please help

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

I am following a roguelike tutorials by Matinator (link: https://www.youtube.com/watch?v=PcbO6aJKGic&list=PL2-ArCpIQtjELkyLKec8BaVVCeunuHSK9&index=2) and he uses the term export without the @
here’s his code, its a bit cut-off:
extends KinematicBody2D
class_name Character, “res://art/v1.1 dungeon crawler 16X16 pixel pack/heroes/knight/knight_idle_anim_f0.png”

const FRICTION: float = 0.15

export var acceleration: int = 40
export var max_speed: int = 100

var mov_direction: Vecter2.ZERO
var velocity: Vector2 = Vector2.ZERO

func _physics_process(_delta: float) → void:
velocity = move_and_slide(velocity)

when i type it it says “Value of type “bool” cannot be assigned to a variable of type “Vector2”.”

please either tell me what version or how to fix it

:bust_in_silhouette: Reply From: jgodfrey

The posted code is for Godot 3.x. The main issue is here:

velocity = move_and_slide(velocity)

move_and_slide no longer takes any arguments and returns a boolean. So, than code should simply be this in Godot 4.

move_and_slide()