You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on a personal project of mine using Godot 4.3 Dev 5 between two computers, my main desktop (Windows 10) and my laptop (Windows 11) using Git. The majority of my project is written in C# and feel like this may only affect C#.
What I have been noticing is that when I make substantial changes in classes that utilize Export vars and resources on one machine, when I pull latest on Git on the other machine and load the project, Godot hasn't compiled the new changes and therefore cannot find objects and variables that the Scene is expecting as attached to parent nodes.
So what it ends up doing is removing the references and paths to these Nodes which in turn can cause data loss if you aren't paying attention. A workaround I have found is to look at my Git changelist, revert those tscn files that should not have been changed, and return to Godot and tell it to reload those files from disk.
If my assessment of this issue is correct, then I believe what could fix it is to have Godot try to compile the C# project before loading up the Scene files (and potentially other file types that might benefit from a pre-compile). This should ensure everything is synchronized before-hand.
Steps to reproduce
Create a project with a .NET build of Godot.
Create a C# script and inherit from something like Control. (I'm sure other types will work)
Create a new scene and add an instance of that node and attach the script
Save all and commit it to Git
On a different machine, pull latest, and load up the project
Alter the C# script so that it has new Export vars
Add new nodes of those Export types to the scene and then attach them to your parent node (the one created on the 1st machine)
Save the project and commit to Git
Return to the 1st machine and pull latest
Load up the project and see if Godot fails to find the changes and children paths created on the 2nd machine. (You should also see the warning in the Inspector that you may need to recompile C#)
Minimal reproduction project (MRP)
I can make a MRP if necessary, though I believe the steps above should be enough to reproduce the issue.
The text was updated successfully, but these errors were encountered:
I had a similar issue for a project that required the C# solution to be compiled for a bunch of tool scripts, so I ended up doing a work around.
The "BuildProject" method in the editor build panel is exposed, so you can make a GDScript EditorPlugin that calls it when your project is opened for the first time.
I had a similar issue for a project that required the C# solution to be compiled for a bunch of tool scripts, so I ended up doing a work around.
The "BuildProject" method in the editor build panel is exposed, so you can make a GDScript EditorPlugin that calls it when your project is opened for the first time.
Ok, that sounds like an excellent work around for now; I'll give that a shot, thanks!
You don't. I should have explained that it's exposed, but not part of the regular API, it's a function of the build panel node in the editor.
You have to get that node to call the function. The way I did it is to loop through basically all the nodes in the editor to find the node via: child.has_method("BuildProject").
Tested versions
System information
Windows 10 & 11
Issue description
I have been working on a personal project of mine using Godot 4.3 Dev 5 between two computers, my main desktop (Windows 10) and my laptop (Windows 11) using Git. The majority of my project is written in C# and feel like this may only affect C#.
What I have been noticing is that when I make substantial changes in classes that utilize Export vars and resources on one machine, when I pull latest on Git on the other machine and load the project, Godot hasn't compiled the new changes and therefore cannot find objects and variables that the Scene is expecting as attached to parent nodes.
So what it ends up doing is removing the references and paths to these Nodes which in turn can cause data loss if you aren't paying attention. A workaround I have found is to look at my Git changelist, revert those tscn files that should not have been changed, and return to Godot and tell it to reload those files from disk.
If my assessment of this issue is correct, then I believe what could fix it is to have Godot try to compile the C# project before loading up the Scene files (and potentially other file types that might benefit from a pre-compile). This should ensure everything is synchronized before-hand.
Steps to reproduce
Minimal reproduction project (MRP)
I can make a MRP if necessary, though I believe the steps above should be enough to reproduce the issue.
The text was updated successfully, but these errors were encountered: