Can I alter world gravity through scripting?
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.
asked Mar 18 '19 at 06:57 PM in Blueprint Scripting
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).
answered Mar 19 '19 at 12:50 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here