Navigation
API > API/Plugins > API/Plugins/GameplayAbilities > API/Plugins/GameplayAbilities/UGameplayEffect
References
| Module | GameplayAbilities |
| Header | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayEffect.h |
| Include | #include "GameplayEffect.h" |
| Source | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayEffect.cpp |
void PostCDOCompiledFixupSubobjects&40;&41;
Remarks
We need to fix-up all of the SubObjects manually since the Engine doesn't fully support this
We now support GameplayEffectComponents which are Subobjects.
When we're loading a Blueprint (including Data Only Blueprints), we go through a bunch of steps: Preload, Serialize (which does the instancing), Init, CDO Compile, PostLoad. However, we are not guaranteed that our Parent Class (Archetype) is fully loaded until PostLoad. So during load (or cooking, where we see this most) is that a Child will request to load, then it's possible the Parent has not fully loaded, so they may also request its Parent load and they go through these steps together. When we get to PostCDOCompiled, the Parent may create some Subobjects (for us, this happens during the Monolithic -> Modular upgrade) and yet the Child is also at the same step, so it hasn't actually seen those Subobjects and instanced them, but it would have instanced them if Parent Class was loaded first through some other means. So our job here is to ensure the Subobjects that exist in the Parent also exist in the Child, so that the order of loading the classes doesn't matter.
There are other issues that will pop-up:
You cannot remove a Parent's Subobject in the Child (this code will just recreate it).
If you remove a Subobject from the Parent, the Child will continue to own it and it will be delta serialized from the Grandparent