# What is the best approach for Directional Gravity and AI Navigation on rotating platforms

**URL:** <https://forums.unrealengine.com/t/what-is-the-best-approach-for-directional-gravity-and-ai-navigation-on-rotating-platforms/444042>\
**Category:** AI\
**Tags:** ai-navigation, platform-support, unreal-engine, UE4, question, CPP\
**Created:** [February 24, 2019, 2:44pm UTC](https://forums.unrealengine.com/t/what-is-the-best-approach-for-directional-gravity-and-ai-navigation-on-rotating-platforms/444042 "2019-02-24T14:44:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![XadE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XadE](https://forums.unrealengine.com/u/XadE)\
**Post date:** [February 24, 2019, 2:44pm UTC](https://forums.unrealengine.com/t/what-is-the-best-approach-for-directional-gravity-and-ai-navigation-on-rotating-platforms/444042/1 "2019-02-24T14:44:54Z")

</div>

Hi there,

I’m using the Unreal Engine since 4.4 version. Now I am facing a great challenge. I have to create a system that will support directional gravity and also work perfectly with the AI navigation system. Modifying the engine’s source code is not a problem. Looking for a C++ solution, not Blueprint.

**Worst case scenario that must be supported:**

- Players fight onboard a large  
spaceship against enemy AI agents,  
using grenades, ranged weapons, laser  
rifles etc.
- In most cases said spaceship will move and rotate, and won’t be static
- The spaceship will substitute the entire level from the player’s  
perspective, the persistent level  
will have only space background  
effects, procedurally generated  
asteroid fields and sometimes a  
background star or planet, thus the  
spaceships are 95% of the gameplay
- There will be more such spaceships with interiors, fighting each other
- Gravity will be generated by spaceship’s gravity engine, gravity  
fields will be tied to spaceship’s  
rotation, and must be handled  
properly by AI agents, too
- In a zero-gravity environment, players may turn on their spacesuit’s  
boosters to move or rotate freely
- This solution must work decently on a procedurally generated spherical  
planets - voxel landscapes
- Number of enemy AI agents will not exceed 30 at a time
- Must work with networking, client-side glitches must be avoided

As far as I know, this is not supported by Unreal Engine by default. I will have to implement it on my own, I guess. Directional gravity for players and rigid bodies itself is trivial to implement, the problem is - it must work properly with AI and networking, and that’s my question here. How to handle that properly? I’ve googled it already with no luck. All I find is a directional gravity, without AI navmesh advice. Navmesh was designed for fixed Z-gravity and static levels. Should I use it, modify it or seek different solutions?

Thank you!

---

<div class="post-metadata">

**Author:** ![jasontodd2324](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jasontodd2324](https://forums.unrealengine.com/u/jasontodd2324)\
**Post date:** [October 8, 2023, 8:36pm UTC](https://forums.unrealengine.com/t/what-is-the-best-approach-for-directional-gravity-and-ai-navigation-on-rotating-platforms/444042/2 "2023-10-08T20:36:25Z")

</div>

did you find something?
