I have a character that i enter on a LevelSequence which starts playing after a key press (for debugging purposes).
The character creates a subobject at runtime on BeginPlay like this:
UPROPERTY(Transcient)
UPaperZDAnimInstance *AnimInstance;
if (AnimInstanceClass && !AnimInstance) {
AnimInstance = NewObject<UPaperZDAnimInstance>(this, AnimInstanceClass);
AnimInstance->Init(this);
}
This works very well… but i discovered that after playing a Sequence in which the character is inside (like trying to move the character, etc) after the IMovieScenePreAnimatedTokenProducer tokens are all called… the AnimInstance is Invalidated (everything inside the AnimInstance is marked as INVALID (the GC acted on that object…What is happening? the UPROPERTY never stops pointing to the object so it couldn’t have been GCed as there’s still a pointer to that UOBJECT