0 votes

Hi...,

I've opened my Godot 3.4.stable projects in Godot 4.0 alpha 7.

In GDscript my following code to get a node:

onready var ballMesh : MeshInstance = $ViewportContainer/Viewport/BallMesh

throws now this error: Unexpected "Identifier" in class body.

What to do?

Thanks

Mike

Godot version Godot 4.0 alpha 7
in Engine by (136 points)

1 Answer

0 votes
Best answer

I believe the "onready" is now an annotation in gdscript2.
See https://docs.godotengine.org/en/latest/tutorials/scripting/gdscript/gdscript_basics.html?highlight=onready#onready-annotation

Basically change "onready" to "@onready"

by (240 points)
selected by

Hi aipie,

that's it, thanks a lot

Mike

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.