Open Xkonti opened 1 month ago
I've also come across this with simple base variable types.
For example, I have a character scene that has a script containing the following:
@export var is_player: bool
@export var cur_hp: int = 25
@export var max_hp: int = 25
None of the rest of the code sets the values for these variables except to update them in response to actions. Now, in my main scene, I have several instances of these Character objects, with different values set for the cur_hp and max_hp in their respective inspector panels, yet when I launch the game, all of them revert to the default values of 25.
Also, saving, exiting and relaunching Godot doesn't make any difference, so this appears to be persistent. If, however, I remove the default values from within the script and simply assign values in the inspector alone, then everything seems to work fine.
(using Godot 4.3 Stable)
Tested versions
System information
Windows 11; Godot 4.3-stable; Forward +
Issue description
I have code that has several exported variables:
The problem didn't occur initially. Now, when I change the exported value in the editor (inspector), it doesn't update during gameplay. Interestingly, it does update the value in the scene file.
During gameplay I added a quick debug print:
Even though the value is set to
0.28
in the scene, during runtime the value shows as the default0.1
:The same goes for the checkbox and other values. They seem to stop reacting to changes in the editor.
Steps to reproduce
Not sure how to reproduce as this worked flawlessly for a while and then out of nowhere it stopped working without making any related code changes.
Minimal reproduction project (MRP)
The whole project is available at GitHub (including assets): https://github.com/Xkonti/PlatformerToolkitGodot