+3 votes

I got a Godot 4.0 unstable build off of https://hugo.pro/projects/godot-builds/ today. I found that some keywords don't work. Mainly, what do you do in the place of export, and onready?

in Engine by (50 points)

2 Answers

+4 votes

@export and @onready. It would be nice if the documentation for 4.0 was finished.

by (86 points)

How do you use it? To export a Node3D variable, what do you do?
I tried this:
@export(Node3D) var follow, but It didn't work

I also tried doing @export var follow: Node3D, @export var follow: Node3D = Node3D.new(), @export var follow: Node3D = null, and @export var follow = Node3D.new()

Unfortunately, there are still a lot of bugs:


+2 votes

For normal variables:

@export var health : int

NodePath export has been changed to this:

@export_node_path(Resource) var resource_name
by (79 points)

Thanks! This is what I was searching for. Where did you get the information about @exportnodepath if you don't mind me asking?

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 Frequently asked questions and 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.