Changing gravity at runtime

Hi all, new to Defold. Giving it a try instead of Unity and I am enjoying it so far (much easier to use). Is there a way to change the gravity at runtime? Ideally I want to give different environments different values for gravity. I did this back when I was using Unity but I cannot figure out a way to do it with Defold as the gravity values seem to be set in game.project

Thanks!

2 Likes

There is no way to change the gravity at runtime. But another way which probably fits your need better (since you want to have different gravity in different environments), is to apply forces on the GOs yourself, have a look at this thread: Can you toggle the gravity in a physics world from the script?

3 Likes

Thanks for the quick reply! I will take a look at that :slight_smile:

2 Likes