I have a custom resource class CombatEffect, and two .tres resource files with CombatEffect as their Script. These two resources are identical, except one is preloaded in a separate resource file. However, this code:
func _ready() -> void:
var effect1 := preload ("res://Data/CombatEffects/EffectThatIsPreloadedElsewhere.tres")
var effect2 := preload ("res://Data/CombatEffects/EffectThatIsntReferencedElsewhere.tres")
print("Effect1")
print(effect1 is Resource)
print(effect1 is CombatEffect)
print("Effect2")
print(effect2 is Resource)
print(effect2 is CombatEffect)
Prints the following:
Effect1
true
false
Effect2
true
true
If I switch the external preload to a load, everything works as expected, but this fails specifically when preloading it elsewhere. I was not able to reproduce this issue in a sample project, so it doesn't seem like it's just a straightforward cyclical reference issue or anything like that. Does anyone have any ideas as to what might be causing this? Thank you.