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.
Coward Would that allow for gravity to be left and right as well?
Clydeclydebank 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.
Coward
So would this work to change the gravity?
Using set_constant_force seems to work, but the marble is still being affected by gravity...
Don't forget to zero-out the default gravity.
Coward Thats what im stuck on...
Clydeclydebank Body's gravity multiplier should be 0
Coward 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?
Clydeclydebank 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.
What version of Godot are you using?
This is a known issue in 4.0
https://github.com/godotengine/godot/issues/72674
Skardol 4.0. Thanks for notifying me of the bug!
© 2022 - 2024 — McMap. All rights reserved.