Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Juxxec |
Greetings!
How can I change the gravity of my entire scene programatically?
I saw that I can use the PhysicsServer
to achieve this. However, when I change the gravity vector, the gravity stops working altogether.
This is the code I am using:
PhysicsServer.area_set_param(get_world().get_space(),
PhysicsServer.AREA_PARAM_GRAVITY_VECTOR, gravity_dir)
PhysicsServer.area_set_param(get_world().get_space(),
PhysicsServer.AREA_PARAM_GRAVITY, 9.8)