# UE5 is there a simple way to override gravity in a volume

**URL:** <https://forums.unrealengine.com/t/ue5-is-there-a-simple-way-to-override-gravity-in-a-volume/790265>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Physics, Blueprint\
**Created:** [March 14, 2023, 4:51am UTC](https://forums.unrealengine.com/t/ue5-is-there-a-simple-way-to-override-gravity-in-a-volume/790265 "2023-03-14T04:51:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 14, 2023, 10:47am UTC](https://forums.unrealengine.com/t/ue5-is-there-a-simple-way-to-override-gravity-in-a-volume/790265/2 "2023-03-14T10:47:32Z")

</div>

> [@anon78908730](#):
>
> In a Sphere the gravity would pull everything to the center of the volume.

See if you can work with something along the lines of:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/d/6cd9bc8d87d6db7421bd04633540cd0e5ac1550d.jpeg)

- an actor with a collision volume detecting components that overlap it
- if the entering comp has an appropriate tag and simulates physics, we add it to an array
- when comps leave volume, we remove them from the array
- the actor applies force to all components that meet the abovementioned criteria

The spheres are unaffected here as they do not have the tag - that’d be one way to exclude things.

> In a Cube, the gravity would change direction, this could point in any direction.

You could use the same method and:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/4/3748498f06db397cf565c5b3e118717d7fab1fbf.png)

Rather than towards the centre.

> attached to the character or a projectile

Sure, why not:

* * *

This can be improved in a number of ways:

- linear and angular dampening could help
- force diminishing with distance for spherical volumes would make it seem more natural, surely

And there’s probably some kinks to iron out, as always. You’d also need to work a bit harder to get it affect player’s movement component.

Perhaps this can get you going, though.

Good luck!

---

_[View the full topic](https://forums.unrealengine.com/t/ue5-is-there-a-simple-way-to-override-gravity-in-a-volume/790265)._
