Invalid call, Nonexistent function 'mormalized' in base 'Vector2' error.

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

I’am beginer (in past i was complete gdscript online course) and i was follow one 2d shooter tutorial and meanwhile coding shoot function i’ve get error :
Invalid call. Nonexistent function ‘mormalized’ in base ‘Vector2’.

    extends KinematicBody2D

export  (int) var rychlost = 150

onready var endOfGun = $endOfGun

var pohyb = Vector2()

export (PackedScene) var bullet

func _ready() -> void:

func _physics_process(delta: float) -> void:
	var movement_direction := Vector2.ZERO
	if Input.is_action_pressed("up"):
		movement_direction.y = -1
	elif Input.is_action_pressed("down"):
		movement_direction.y = 1
	if Input.is_action_pressed("left"):
		movement_direction.x = -1
	elif Input.is_action_pressed("right "):
		movement_direction.x = 1
	movement_direction = movement_direction.normalized()
	pohyb = move_and_slide(movement_direction * rychlost)

func _unhandled_input(event: InputEvent) -> void:
	if event.is_action_pressed("střílení"):

func shoot():
	var Bullet_instance = bullet.instance()
	Bullet_instance.global_position = endOfGun.global_position
	var target = get_global_mouse_position()
	var direction_to_mouse = Bullet_instance.global_position.direction_to(target).mormalized()

func vykuchani():

func _on_Area2D_body_entered(body):
	if "buzerant" in

Once i’ve sad i’am beginer and i don’t have much experience’s
with coding.
So if threre someone who can help me, i will be grateful to him.

? Dont you mean normalized ? You even used it in your physics process function.

Enfyna | 2023-06-19 19:20

Indeed, try changin

var direction_to_mouse = Bullet_instance.global_position.direction_to(target).mormalized()


var direction_to_mouse = Bullet_instance.global_position.direction_to(target).normalized()

You have a typo normalized vs mormalized. The error message is stating mormalized is not a function of vector2s

godot_dev_ | 2023-06-19 19:33

Sorry i wasn’t noticed that and thanks for the help.

BlinMaker2077 | 2023-06-20 17:51