-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
[Mono] Loading a scene with unbuilt/unexported variables automatically erases them. #15371
Comments
Not only building it before opening the scene sounds like a hacky workaround, but if building fails then you still lose the variables. |
Oh, wait. Actually the same happens with GDScript. Implementing automatic building should solve this issue then (supposing build doesn't fail), but IMO losing changes on exported variables when a build fails is really bad... |
Yeah, I am using export variables a lot with tool scripts, and if I make an error, they are gone until I fix it. I wish it didn't happen... |
So, maybe Godot itself should just keep the variables until there's a successful build? This should cover all cases in all languages.. maybe? |
I think yes, and instead of the reset-to-default button show a warning icon or something. |
Look what I found: #17070 |
|
Update: This issue is still valid. It was a special case which made me unable to reproduce it. Interestingly, thanks to this I started to understand the cause. I think I came up with a good solution and I made a basic implementation for C# scripts. So far it seems to be working, but I haven't tested much. Another important fact to keep in mind is that this issue may not only affect properties, as it seems to be the case with #17070. Anyway, I would really like to hear opinions. Specially @reduz Reminder: this issue affects all script languages, not only C#. |
Godot version:
34c988c
OS/device including version:
Any
Issue description:
Any variables in the main scene or any scene that gets opened before the Mono assembly is built will be automatically erased.
The most practical solution seems to be to build the mono assembly immediately upon opening the project prior to any scene opening. This way, any changes from other team mates that have been pulled in will also have their variables intact instead of erased
Steps to reproduce:
Minimal reproduction project:
The following project is the same one used in the video
Project:
https://github.com/NathanWarden/godot_ai_csharp
Video:
https://youtu.be/ymvryIPuZRU
The text was updated successfully, but these errors were encountered: