Godot Version
4.7.2 stable
Question
when i try to launch the scene of the movement of the player (similas movement to games like undertale and deltarune if it helps), it crashes, giving the error physics_process_: invalid call. nonexistent ´vector2´ constructor. since i started programming one week ago, i have no idea what this means. any clue?
extends CharacterBody2D
var velocidad = 200
var animacion = ""
@onready var animaciones = $Sprites_Jugador
@onready var mira = $RayCast_Jugador
func _physics_process(_delta):
var movimiento = Vector2(velocidad)
if Input.is_action_pressed("ui_up"):
movimiento.y -= velocidad
if Input.is_action_pressed("ui_down"):
movimiento.y += velocidad
if Input.is_action_pressed("ui_right"):
movimiento.x += velocidad
if Input.is_action_pressed("ui_left"):
movimiento.x -= velocidad
move_and_slide()