Hi there !
I was searching for a way to swap gravity on blueprint “cube” actors, during the game.
Yesterday, I was using UE 4.7, and I found this solution :
But today, I thought it was time to update to 4.10, so I did. The project opened succesfully, but the only thing that doesn’t work is… The reverse gravity function…
Here is my cube actor’s blueprint :
http://grab.by/NW3w (Force’s default value is 0,0,-20)
The “Reverse Gravity” event is fired when I press G key.
But whereas the gravity seemed realistic in 4.7, now the cube is just slipping on the floor when I push it, like air hockey, and it also rotates very fast. (It has no gravity.)
Could you help me ?
PS: Sorry for if my english is bad, I’m actually French !
Where do you set the “Force” Variable initially?
if this is set to nothing… it’ll do nothing, if the object is moving it’ll work.
you also have “Add Force” set, which means every tick, you are adding more and more force to the object which would explain why it gets faster and faster until it hits the limits of the physics engine.
if you want to control gravity, try and restrict yourself to working on the Z axis.
The Force variable is a variable of the cube, which is set by default to -20, and which is “editable on spawn” so that I can change it within the map editor.
The Add Force is checked because gravity is an acceleration.
But the cube in game currently has no force ! It’s not getting faster and faster, it just like levitates.
I think you didn’t read carefully the question