Magical error ahead.
My game has modes that are equipped by the player and then activated and deactivated by them; the player must have the mode equipped in order to activate it.
If I equip the mode, activate it, then stop PIE : nothing happens.
if I equip, activate, deactivate, then stop PIE: nothing happens.
If I equip, activate, deactivate, unequip, then stop PIE: nothing happens.
If I equip, activate, unequip (which automatically deactivates the mode), then stop PIE:
[2017.02.16-15.41.47:235][173]LogWindows:Error: Fatal error: [File:D:\Build\++UE4+Release-4.14+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp] [Line: 547]
[2017.02.16-15.41.47:235][173]LogWindows:Error: Invalid object in GC: 0x0000000047ec1d20, ReferencingObject: ParticleModuleColorOverLife /Game/Effects/Fire/fxp_Fire_Explosion01.fxp_Fire_Explosion01:ParticleModuleColorOverLife_5, ReferencingObjectClass: Class /Script/Engine.ParticleModuleColorOverLife, Property Name: Distribution, Offset: 200, TokenIndex: 7
OR
[2017.02.16-16.32.57:884][635]LogWindows:Error: Fatal error: [File:D:\Build\++UE4+Release-4.14+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp] [Line: 547]
[2017.02.16-16.32.57:884][635]LogWindows:Error: Invalid object in GC: 0x0000000047f9e380, ReferencingObject: CombatEffectBuff /Game/Developers//Talents/TestTalent.TestTalent:ActionDirect_20.CombatEffectBuff_69, ReferencingObjectClass: Class /Script/Resurgence.CombatEffectBuff, Property Name: Buffs, Offset: 56, TokenIndex: 6
TestTalent is a data asset with a TArray of instanced subobjects (including modes and direct actions); those subobjects themselves have instanced subobjects (eg combat effects) as well as references to other assets (eg particle effects).
The mode I’ve been testing with is one of TestTalent’s subobjects, the particle effect is referenced by a different subobject, and ActionDirect_20 is a third. To reiterate, these are three different subobjects of TestTalent. (Because it likely matters: in TestTalent’s array, the object with the particles is index 0, ActionDirect_20 is 1, and the mode is 2)
The second error message only appears when I remove the reference to the particle effect; when I re-add the reference, the first error message returns.
Regarding triggering the error, the auto-deactivation of the mode uses the same function as manually deactivating it.
Is there something that could cause the GC to somehow miss its target? And if so, how do I fix this?