Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export var ruins Instantiated objects export variables #28425

Open
timjo6789 opened this issue Apr 25, 2019 · 1 comment
Open

Export var ruins Instantiated objects export variables #28425

timjo6789 opened this issue Apr 25, 2019 · 1 comment

Comments

@timjo6789
Copy link

timjo6789 commented Apr 25, 2019

Godot version:
Godot_v3.1-stable_win64

Issue description:
Main's instance object.tscn of a variable named example is set to 30.
Here's a line from object.gd,
export var example = 42
I found that removing "export" from above line and then saving the project removes all other instantiated object.tscn's example variable.
Then by adding "export" back and then saving which reverts all other example variable back to 42 instead of 30.
This is a very serious issue for two reasons, there is no undo button and I have made levels with export variables set and I have made a mistake of removing "export" in code and then saving the project which messed up my levels.

Steps to reproduce:
Open bug_showcase.zip
Look at Node2D in Main.tscn first to see the number 30
Remove "export" from line 3 in object.gd.
Save.
Then put back "export".
Save.
You will see in the Main.tscn and by inspecting Node2D that 30 has been replaced by 42.

Minimal reproduction project:
bug_showcase.zip

@KoBeWi
Copy link
Member

KoBeWi commented Jul 5, 2019

This does not happen if the affected scene isn't opened. What happened is likely that you saved your scene along with the script, which removed the old value. Everything should be alright until you save the scene, in which case you can revert it after a mistake.

Not sure if there's anything that can be done about this issue, just be careful with the variables I guess. We could register adding/removing an export variable as an undo action, but that sounds really unlikely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants