# Can I alter world gravity through scripting?

**URL:** <https://forums.unrealengine.com/t/can-i-alter-world-gravity-through-scripting/445536>\
**Category:** World Creation\
**Tags:** gravity, physics-objects, unreal-engine, runtime, Scripting, question, Blueprint\
**Created:** [March 18, 2019, 6:57pm UTC](https://forums.unrealengine.com/t/can-i-alter-world-gravity-through-scripting/445536 "2019-03-18T18:57:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VagrantProfile](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VagrantProfile](https://forums.unrealengine.com/u/VagrantProfile)\
**Post date:** [March 18, 2019, 6:57pm UTC](https://forums.unrealengine.com/t/can-i-alter-world-gravity-through-scripting/445536/1 "2019-03-18T18:57:42Z")

</div>

Soooo…

I want to be able to alter my level’s “World Gravity” at runtime. Is there a way to do this through scripting? I know I can SET my Default Gravity Z in the project settings…and even override that in the World Settings…but is there a way I can alter it at runtime? As an example, I’d like to have “normal” gravity and then once my player overlaps a trigger volume I alter the gravity such that all physics objects float away.

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [March 19, 2019, 12:50pm UTC](https://forums.unrealengine.com/t/can-i-alter-world-gravity-through-scripting/445536/2 "2019-03-19T12:50:39Z")

</div>

A similar question was asked so many times that Epic Games should really consider adding the possibility to change gravity via blueprints =)

Anyway, you can use a workaround: set physics objects’ Simulate Gravity to False and Add Impulse once (if you just want them to behave like in zero gravity and just float away a bit), or Add Force on Tick (if you want to simulate the gravity angle change).

---

<div class="post-metadata">

**Author:** ![Rostropovicho](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rostropovicho/32/88708_2.png) [@Rostropovicho](https://forums.unrealengine.com/u/Rostropovicho)\
**Post date:** [July 13, 2023, 11:40am UTC](https://forums.unrealengine.com/t/can-i-alter-world-gravity-through-scripting/445536/3 "2023-07-13T11:40:19Z")

</div>

Hey! This is so goood! You really helped me to implement an independent “gravity 0” for every independent object.

But now I would like to drag or kind of stop the displacement in space of these objects after a given time, is that possible??

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [July 13, 2023, 8:50pm UTC](https://forums.unrealengine.com/t/can-i-alter-world-gravity-through-scripting/445536/4 "2023-07-13T20:50:14Z")

</div>

Just add a timer to your object’s BP and counter the impulse by applying the exact reverse value of it to cancel out any movement.

Its not rocket science (but it is!)…
