Godot Version
v4.2.2.stable.official [15073afe3]
Question
Hello everyone. I’m experiencing a weird problem with exported properties when working on multiple workstations. My main workstation is an Windows 10 machine with Godot 4.2.2.stable installed, but sometimes, I’m checking out the project on my M1 Sonoma Macbook, and try to export the game to the iPad. I’m transferring the project between machines with the git repository.
In one scene in my project, I have a tree hierarchy that looks like this:
“Database” node contains references to other nodes. Those references are stored in exported typed array.
extends Node
@export var deck_definitions : Array[DeckDefinition]
and the same goes with “DeckDefinitions”
class_name DeckDefinition extends Node
@export var card_definitions : Array[CardDefinition]
And this works good, the exported property displays correctly in the inspector, the game exports to Windows build correctly.
However, after committing this changes, and then checking it out on Mac in the editor, property is missing.
If I save the scene, and then check the local changes in git, I can see that the property was deleted by the editor.
After reverting this change, and restarting the editor - it reappears and works correctly. But when I force project to reimport (by deleting .godot folder) it happens again.
Unfortunately even if I manage to make it work correctly in editor, after exporting the game to the iPad, the problem still persists.
I tried to recreate the issue in smaller project, to do an minimal reproduction steps for the issue, but I wasn’t able to. My theory here is that there is probably an race condition during the project import. When editor tries to import Database, it doesn’t know about DeckDefinition/CardDefinition yet, so it deletes the references. That could explain why it works after deleting the changes in git after project is properly imported. However I thought that maybe it’s an typed array related issue, I checked that with non-typed array, and the problem still persist.
Has anyone experienced something like this before? Is there any way to prevent this issue?