-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
C# Export members no more initialized #54414
Comments
I can't reproduce this issue, can you upload a minimal reproduction project? This could be related to #37812 and/or #51626 but both of those issues already existed before 3.4 RC2. Are you sure you couldn't reproduce it in RC1? The PR you mentioned shouldn't be causing this issue and don't see any commits between RC1 and RC2 that could be causing this. |
I'll try to create a minimal project. Currently i'm working with RC1 without any issues and as soon as i switch to RC2 it's not. |
Actually it seems related to [Tool] - When i open the project with RC1 i can change the variable and it is reflected by a program start (GD Print Output). If i open it with RC2 i can change it, but it will stay to 0. |
I can reproduce this with 3.4 beta 6 so I think your issue is not specific to RC2, what I also noticed is your scene looks like this: [gd_scene load_steps=2 format=2]
[ext_resource path="res://SpatialTest.cs" type="Script" id=1]
[node name="Spatial" type="Spatial"]
SomeVariable = 4
script = ExtResource( 1 ) When opening the scene in Godot, [gd_scene load_steps=2 format=2]
[ext_resource path="res://SpatialTest.cs" type="Script" id=1]
[node name="Spatial" type="Spatial"]
script = ExtResource( 1 )
SomeVariable = 4 Then it seems to work fine, so I guess the problem is due to the order in which the scene is deserialized. And now that the issue seems to be caused by the order of the variables in the scene I can see how the PR you mentioned might have caused this issue. |
After removing [Tool] it also works fine in my main project in RC2 after reassigning the variables. Reopening / Closing the project works flawless then - But in the upgrade process they broke. Adding [Tool] again, they are all zero again at launch of my game and after saving. |
It's a duplicate of #37812 then and should be closed |
@Chaosus I don't think so since this is caused by different reasons. This issue is caused by the script variables being serialized before the script property (causing them to be ignored on deserialization). It only affects Tool scripts because of how the loading of their properties values is handled by the editor. #37812 seems to be caused by assembly reloading not being able to keep the values of Tool script properties. |
Godot version
3.4 RC2 / Mono
System information
Windows 11, Intel 655
Issue description
Opening my existing project in the editor shows all variables initialized.
Starting the project gives me errors because they are actually set to zero.
Upon closing and opening the scene all variables are actually set to zero.
Even assigning new values and saving the scene has no effect.
Maybe this is related to
#54199 ? (Keep order of c# export members)
Steps to reproduce
Having a RC1 Project with export members, open the scene and run it - everything is not initialized. In RC1 everything works fine but variables are displayed unordered:
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: