When the rigidbody is at high speeds, It will clip into the floor. I suspect the issue is from my custom physics settings to allow for changes in gravity. Does anyone know if theres a way to fix my code (or if theres a better way to implement changing gravity)?

Is there a way to implement Continuous CD in code? As i dont think that option does anything with custom physics...

Why do you need a custom integrator for this? You could just change rigid body's gravity scale property.

    SuperMatCat24 No. In that case you can use add_central_force(). When gravity needs to flip, just add the opposite of the current gravity force to nullify it, and then add the new one.

      Using set_constant_force seems to work, but the marble is still being affected by gravity...

      xyz Doing that and setting constant y to 980 makes slopes and other things feel really jittery. Is there a way to set the global gravity while running?

      • xyz replied to this.

        SuperMatCat24 You should change the gravity force only once, not perpetually and try to use *_central_force() insted *_force(). Alternatively you could apply central impulse every frame but that'd make the behavior frame-rate dependent.

        5 days later