Modify Flight Path Camera / Get Velocity from Dynamic Pawn

Hello, I am trying to customize the flight path heavily with my character.

Currently my game character is not anchored to the Earth and is extremely customized so I cannot change its base class. I am currently using a trick, that I am unsure is the best bet, but works for now.

When I want to travel the Earth, I spawn a DynamicPawn, attach my character to it, posses it, then have the DynamicPawn do its move, then when done, set georeference origin, detach my character, re-posses it and then delete the DynamicPawn.

If I don’t posses the DynamicPawn first and do the move, I get a crash.

If there is a better way to do this, it would be appreciated to understand.

This leads to my next issue. When I attach my character, it uses the default camera of the DynamicPawn, and I want to modify this camera to follow the flight path, like a Superman animation.

I can calculate the rotation that the character should be facing with velocity, but the velocity of my DynamicPawn always returns 0. I assume this is due to some custom georeference movement process and its not actually moving?

Is there way to extract more data out of the flight path, such as direction, etc? Or is there any other way you might see a solution for this?

Thank you!

-Brandon

What sort of crash are you seeing when you move without using the DynamicPawn?

Perhaps you can just attach a CesiumGlobeAnchor to your game character rather than trying to use the DynamicPawn at all?

If I skip posessing the DynamicPawn before travelling, this is my crash log:

[2023.05.30-01.14.48:161][ 21]LogWindows: Error: === Critical error: ===
[2023.05.30-01.14.48:161][ 21]LogWindows: Error:
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: Fatal error!
[2023.05.30-01.14.48:161][ 21]LogWindows: Error:
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000000
[2023.05.30-01.14.48:161][ 21]LogWindows: Error:
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff75fb6e6d UnrealEditor-CesiumRuntime.dll!AGlobeAwareDefaultPawn::FlyToLocationECEF() [V:\Virtuoso2023\Virtuoso\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\GlobeAwareDefaultPawn.cpp:100]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff75fb773d UnrealEditor-CesiumRuntime.dll!AGlobeAwareDefaultPawn::FlyToLocationLongitudeLatitudeHeight() [V:\Virtuoso2023\Virtuoso\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\GlobeAwareDefaultPawn.cpp:223]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff75fb762d UnrealEditor-CesiumRuntime.dll!AGlobeAwareDefaultPawn::FlyToLocationLongitudeLatitudeHeight() [V:\Virtuoso2023\Virtuoso\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\GlobeAwareDefaultPawn.cpp:237]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff7601ef3b UnrealEditor-CesiumRuntime.dll!AGlobeAwareDefaultPawn::execFlyToLocationLongitudeLatitudeHeight() [V:\Virtuoso2023\Virtuoso\Plugins\CesiumForUnreal\Intermediate\Build\Win64\UnrealEditor\Inc\CesiumRuntime\GlobeAwareDefaultPawn.gen.cpp:88]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c1bdbb7 UnrealEditor-CoreUObject.dll!UFunction::Invoke() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:5912]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3cdb37 UnrealEditor-CoreUObject.dll!UObject::CallFunction() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1012]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e04c3 UnrealEditor-CoreUObject.dll!UObject::ProcessContextOpcode() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2871]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e3181 UnrealEditor-CoreUObject.dll!ProcessLocalScriptFunction() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1082]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3b96de UnrealEditor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void )>() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:912]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e2d6f UnrealEditor-CoreUObject.dll!ProcessLocalFunction() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1143]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e04c3 UnrealEditor-CoreUObject.dll!UObject::ProcessContextOpcode() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2871]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e3181 UnrealEditor-CoreUObject.dll!ProcessLocalScriptFunction() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1082]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3b96de UnrealEditor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl
)(UObject *,FFrame &,void *)>() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:912]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e2d6f UnrealEditor-CoreUObject.dll!ProcessLocalFunction() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1143]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e3181 UnrealEditor-CoreUObject.dll!ProcessLocalScriptFunction() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1082]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e2494 UnrealEditor-CoreUObject.dll!UObject::ProcessInternal() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1170]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c1bdbb7 UnrealEditor-CoreUObject.dll!UFunction::Invoke() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:5912]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c3e1a87 UnrealEditor-CoreUObject.dll!UObject::ProcessEvent() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2003]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff860e8f97 UnrealEditor-VaRest.dll!UVaRestSubsystem::OnCallComplete() [V:\Virtuoso2023\Virtuoso\Plugins\VaRestPlugin\Source\VaRest\Private\VaRestSubsystem.cpp:73]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff860e4c5c UnrealEditor-VaRest.dll!TBaseUObjectMethodDelegateInstance<0,UVaRestSubsystem,void __cdecl(UVaRestRequestJSON *),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:611]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff860e1aa0 UnrealEditor-VaRest.dll!TMulticastDelegate<void __cdecl(UVaRestRequestJSON *),FDefaultDelegateUserPolicy>::Broadcast() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:967]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff860e94f1 UnrealEditor-VaRest.dll!UVaRestRequestJSON::OnProcessRequestComplete() [V:\Virtuoso2023\Virtuoso\Plugins\VaRestPlugin\Source\VaRest\Private\VaRestRequestJSON.cpp:570]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff860e4b08 UnrealEditor-VaRest.dll!TBaseUObjectMethodDelegateInstance<0,UVaRestRequestJSON,void __cdecl(TSharedPtr<IHttpRequest,1>,TSharedPtr<IHttpResponse,1>,bool),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:609]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff616bdeea UnrealEditor-HTTP.dll!TDelegate<void __cdecl(TSharedPtr<IHttpRequest,1>,TSharedPtr<IHttpResponse,1>,bool),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:607]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff616d1b0c UnrealEditor-HTTP.dll!FCurlHttpRequest::FinishedRequest() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Online\HTTP\Private\Curl\CurlHttp.cpp:1278]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007fff616f0155 UnrealEditor-HTTP.dll!FHttpManager::Tick() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Online\HTTP\Private\HttpManager.cpp:356]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c9430f5 UnrealEditor-Core.dll!TBaseRawMethodDelegateInstance<0,FTSTickerObjectBase,bool __cdecl(float),FDefaultDelegateUserPolicy>::Execute() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:453]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c952769 UnrealEditor-Core.dll!FTSTicker::Tick() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Private\Containers\Ticker.cpp:110]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c938aa9 UnrealEditor-Core.dll!<lambda_6beaae88040881b26294c7e6ac50b595>::operator()() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Private\Containers\BackgroundableTicker.cpp:24]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c943060 UnrealEditor-Core.dll!TBaseFunctorDelegateInstance<bool __cdecl(float),FDefaultDelegateUserPolicy,TFunction<bool __cdecl(float)> >::Execute() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:831]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff80c952769 UnrealEditor-Core.dll!FTSTicker::Tick() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Core\Private\Containers\Ticker.cpp:110]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff6be2ab267 UnrealEditor.exe!FEngineLoop::Tick() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5439]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff6be2c0d9c UnrealEditor.exe!GuardedMain() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Launch\Private\Launch.cpp:183]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff6be2c0e8a UnrealEditor.exe!GuardedMainWrapper() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff6be2c3c4d UnrealEditor.exe!LaunchWindowsStartup() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff6be2d5564 UnrealEditor.exe!WinMain() [U:\Source\UE503\UnrealEngine-5.0.3-release\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff6be2d8736 UnrealEditor.exe!__scrt_common_main_seh() [d:\a01_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff8ccac7614 KERNEL32.DLL!UnknownFunction
[2023.05.30-01.14.48:161][ 21]LogWindows: Error: [Callstack] 0x00007ff8ce5c26a1 ntdll.dll!UnknownFunction
[2023.05.30-01.14.48:162][ 21]LogWindows: Error:
[2023.05.30-01.14.48:173][ 21]LogExit: Executing StaticShutdownAfterError
[2023.05.30-01.14.48:192][ 21]LogWindows: FPlatformMisc::RequestExit(1)
[2023.05.30-01.14.48:192][ 21]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3)
[2023.05.30-01.14.48:192][ 21]LogCore: Engine exit requested (reason: Win RequestExit)
[2023.05.30-01.14.48:199][ 21]Log file closed, 05/29/23 20:14:48

As far as not using the DynamicPawn, its necessary for the character class to derive from GlobeAwareDefaultPawn to use the function FlyToLocationLongitudeLatitudeHeight, in which my character is not, and at this point, is to complex to accommodate such a change. I just learned you can have the GlobeAnchor move to ECEF coordinates, but its not animated like the DynamicPawn, also it uses ECEF, and I am using PlacesAPI to geocode Long/Lat, which is incompatible.

Ok, the best solution for now might be to copy some code out of the GlobeAwareDefaultPawn. I’d like to make the camera flights a separate component (we’ve already done this in Unity), but can’t promise how soon we’ll get to it.

The ECEF versus Long/Lat thing shouldn’t be a major problem, at least. You can set a CesiumGlobeAnchorComponent’s location with Longitude/Latitude/Height by calling MoveToLongitudeLatitudeHeight. You’re right that it’s not animated, though.

This might be a bit much for me. I can have a programmer of mine look at it. Would be great to see a CameraFlightComponent some day.

Say I just keep using my method for now. Is there a way to get a look at direction between the 2 move points so I can make the camera/pawn aim the direction the DynamicPawn is moving?

Just subtract? If you have the previous and next positions, subtract previous from next and that’ll give you a vector pointing from previous to next.