FlyToLocation arrives at location, then flies straight up

I’m trying to fly from my starting location to another location. When I move to the new location the pawn starts to fly up (z-axis). If I fly back to the original location, it stays put when it arrives.

I’ve tested Fly to Location LLH/ECEF versions as well as the MoveTo version. In all cases my class (derived from GlobeAwareDefaultPawn):

  1. arrives at the second destination
  2. it appears the GlobeAnchor location is properly updated
  3. the OnFlightComplete event fires
  4. my pawn immediately flies up (perpendicular) to the new location.
  5. If I get the actor velocity (when the OnFlightComplete fires) it returns x=0.000 y=0.000 z=1000000.000.

So far I am unable to figure out where this velocity is coming from. Has anyone else encountered this? Any ideas how to troubleshoot? I’ve turned off physics, collision, and anything else I can think of. I’ve tried to zero out any velocities, inputs, but it still flies off the planet at the second location.

Any help would be appreciated.

Adding a bit more information…

  1. It seems the z velocity after flying/moving is being set to the value the Movement Component has set in its “Max Speed” field.

  2. The issue only seems to happen when the second location is a large distance away from the original origin. I’m not certain of the threshold distance but I would estimate something larger than 1500km or so.

Hi @sewellkr3,

Are you using Unreal Engine 5.1? If so, you will have to disable “Enable World Bounds Checks” in the project settings, otherwise the game will try to pull you back into a limited “bounds” if you fly too far away.

1 Like

Janine,

Yes, I am using 5.1, sorry I forgot to include that info.
And thank you very much, that was the problem, it’s working great now.

For any others looking for the setting, it’s not under the project settings, but the world settings:

  1. Choose Window->World Settings
  2. In the “World Settings” window, find the “World” section and expand “Advanced” to find the option.