Godot not understanding @export var defaults

Godot Version



It’s simple. I made an export variable like that:

@export var allowZooming:bool = true

After saving the file (I use external VS code editor) and I go back to godot all the variables are set to 0, so allowZooming is set to 0 or false.
I know VS code is connected because I can see the output in the terninal.
What can I do?

Did you set a value in the inspector?

actually after a computer reboot it is working correctly, but sometimes can be problematic after changing the defaults in code and in godot

You can just reload the project from the project menu to solve this. Link between VSCode and Godot can be sometime weird. If you change something while the project is running it can reverse when stopping the project and same happens when you connect signal from the inspector.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.