This is my first time opening up Godot and coding
I copied this code from some guy in yt.
This is for 2d top down movement, and I don't know what's the error. I asked chatgpt and bard about it, and yet there's still an error/
extends CharacterBody2D
var speed = 200
var velocity = Vector2()
func _ready():
pass
func _physics_process(delta):
velocity = Vector2()
if Input.is_action_pressed("right"):
velocity.x += speed
if Input.is_action_pressed("left"):
velocity.x -= speed
if Input.is_action_pressed("top"):
velocity.y -= speed
if Input.is_action_pressed("down"):
velocity.y += speed
move_and_slide(velocity)
look_at(get_global_mouse_postion())