Start function with an Area2D

Godot Version

Godot_v4.1.3-stable_mono_win64

Question

EN:
Hello,
I’m learning Godot by following the tutorial on the official website. At the very beginning of the tutorial, you have to create a 2D scene to play it and add an Area2D as the main node, which is then called ‘Player’. Further on in the tutorial, in another scene called ‘Main’ which groups all the scenes created previously, you have to write this line of code in a _new_game () function:

$Player.start($StartPosition.position)

When I launch the game, an error message appears saying that it’s not possible to use ‘.start’ after an Area2D, which is perfectly stupid as the tutorial asks you to create a 2D Area for the player. Thanks in advance for your help.

FR:
Bonjour,
J’apprends Godot en suivant le tuto du site officiel. Au tout début du tuto, il faut créer une scène 2D pour le jouer et lui ajouter comme noeud principal une Area2D qui est nommé par après “Player”. Plus loin dans le tutoriel, dans une autre scène “Main” regroupant toutes les scènes crées précédement il faut écrire cette ligne de code dans une fonction _new_game ():

$Player.start($StartPosition.position)

Quand je lance le jeu, un message d’erreur apparait disant qu’il n’est pas possible d’utiliser “.start” apres une Area2D ce qui est parfaitement stupide puisque le tuto demande de créer une Area 2D pour le joueur. Merci d’avance pour votre aide.

It looks like you missed the last paragraph of this page, which instructs you to create a start function for the Player: Coding the player — Godot Engine (4.1) documentation in English

2 Likes

Which paragraph exactly ?

func start(pos):
	position = pos
	show()
	$CollisionShape2D.disabled = false

the very very last code block

1 Like