C# scenes with NodePath
s randomly fail to load correctly (instead replaced with null)
#93083
Labels
NodePath
s randomly fail to load correctly (instead replaced with null)
#93083
Tested versions
System information
Most likely Windows 10 with Vulkan Forward+ renderer and a cyrillic locale (only players have seen this issue)
Issue description
It seems that Godot 4 randomly fails to load
NodePath
export variables for C# scripts when instantiating scenes. The scenes in question load fine thousands of times, but very rarely it seems like they don't load correctly after playing some time.I know this is basically probably unsolvable but I want to report this problem anyway as I've received multiple reports from players of my game that they have gotten this issue. I've opened a meta tracking issue in my repo about this: Revolutionary-Games/Thrive#5209
There's a chance that this is not in the end an engine issue, but all the info so far I have about this is that for some reason an instantiated C# class just has some export properties set to null when loading. Way earlier in the process from porting from Godot 3 to 4 I noticed 2 scenes that were much much more likely to have this issue present in them and I switched them to using direct node references. That seems to be a working workaround for this as I've not received any reports where those two scenes. So that leads me to believe there is some rare bug in the engine related to
NodePath
variable handling in scene instantiation.I have not switched everything over to using direct node references as it would be a lot of work to convert over hundreds of scenes. Once that is eventually done, this issue should no longer really be relevant to Thrive anymore.
Steps to reproduce
[Export]
variable ofNodePath
typeMinimal reproduction project (MRP)
I think it speaks to the rarity of the issue that the Godot 4 version of Thrive has been downloaded thousands of times but I have received less than 5 reports of this problem.
So even if I tried for hours it would be unlikely I would be able to make a MRP.
Version of Thrive that definitely has this issue in it is: https://github.com/Revolutionary-Games/Thrive/tree/v0.6.6 (I added some workarounds in later patches so this issue may no longer be able to be triggered as I switched a few more scenes to use node references instead of paths).
The text was updated successfully, but these errors were encountered: