I have a little problem with the tutorial of your first 2d Game

this is the code:


extends Node

@export var mob_scene: PackedScene
var score

func _ready():

func _on_player_hit():

func game_over():

func new_game():
score = 0

func _on_mob_timer_timeout():

var mob = mob_scene.instantiate()

var mob_spawn_location = $MobPath/MobSpawnLocation
mob_spawn_location.progress_ratio = randf()

var direction = mob_spawn_location.rotation + PI / 2

mob.position = mob_spawn_location.position

direction += randf_range(-PI / 4, PI / 4)
mob.rotation = direction

var velocity = Vector2(randf_range(150.0, 250.0), 0.0)
mob.linear_velocity = velocity.rotated(direction)


func _on_score_timer_timeout():
score += 1

func _on_start_timer_timeout():

i don’t know how resolve the problem

If you need the other code “player” and “mob” tell me and i show you but is just the same of the tutorial (i think)

StartPosition should be under Main not under Player, you’ve put everything under Player instead of under Main, see:

1 Like

yep, before i feel sleepy i look the docs and change that but my error still there:frowning_face:

ikn what to do