From 0ad6346e8b7c564a9dfe605c0f06143c6534f2ee Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Fri, 25 Jun 2021 02:41:52 -0700 Subject: [PATCH] [LYN-4718] [Forums]: [Bug] Editor crashes consistently when EmotionFX is open and Play Game is used (#1552) --- Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.cpp b/Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.cpp index 0a1137d7d9..69cccace81 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.cpp @@ -63,6 +63,8 @@ namespace EMotionFX &actorSettings, ""); + // Set the is owned by runtime flag before finalizing the actor, as that uses the flag already. + assetData->m_emfxActor->SetIsOwnedByRuntime(true); assetData->m_emfxActor->Finalize(); // Clear out the EMFX raw asset data. @@ -74,8 +76,6 @@ namespace EMotionFX return false; } - assetData->m_emfxActor->SetIsOwnedByRuntime(true); - // Note: Render actor depends on the mesh asset, so we need to manually create it after mesh asset has been loaded. return static_cast(assetData->m_emfxActor); }