Godot Version
v4.5.stable.mono.official [876b29033]
Question
How can I stop Rigidbody3D’s from rolling around with seemingly no force pushing them?
My game involves moving around many small objects of all sizes. A lot of these objects are either cylinders or spheres. When I have a bunch of them while playing the game I will turn my back for a moment and they have all rolled away. The surface they are on in flat and even. They require no push to roll. If I place them on the ground from still they will begin to roll every time.
(I tested it and the direction it rolls seems to be arbitrary. Meaning it is definitely not just a slightly uneven surface its rolling down)
I have tried setting the angular damp but that only slows the speed that it will increase to from stand still.
Follow-up question:
If there is a setting on Rigidbody3D’s that fixes this, is there a way that I can automatically apply it as a default on all my Rigidbody3D’s without having to manual set each one?
This isn’t something I’ve come across myself, and I built a marble game as my first Godot project (i.e. a sphere rolling on surfaces – many of which were flat ones).
- Which physics engine are you using?
- Have you tried switching between these physics engines to see if that fixes the issue?
- How big is the object in the video (i.e. what’s the size of the collider)?
- What’s the collision setup for the terrain?
Please provide more information, and we can try solving your problem.
Thanks for the reply.
The physics engine I’m using is Jolt and when turning it off it does stop, but unfortunately using Jolt is very important for my game which heavily involves rigidbodies interacting with each other in a certain way and on top of that, a lot of stuff breaks when switching to GodotPhysics3D.
I had a play around with the sizes of objects and it does seem like its happening with cylinders that have a radius of 0.16m and smaller but spheres having more range of movement roll at larger sizes. I’ve created a large flat collision area using a primitive godot shape that definitely has no tilt to it to test this and it still happens so it can’t be an issue with my specific collisions.
I’m unsure if my scale is smaller than usual. I am using small objects but they are to scale with my players model being about 2m tall.
There has to be something in Jolt that is causing this that can be fixed without me having to switch off of it because I simply can’t do that for this project.
I might make a new project and test it to make sure that there’s not something I’ve added that is causing it.
I think I have found the issue. In order for a system I’ve made to work correctly I had to disable “Allow Sleep” in the Jolt settings and that seems to be the cause.
If I this enabled I was able to have rigidbodies not be affected by gravity in a certain circumstance that is very easy to replicate with my game so I disabled it and that seems to be allowing them to gain momentum from nothing.
Edit:
After some testing I’ve realised that the circumstances that allowed me to make objects float due to not being woken up are not relevant anymore in my project so I would suggest anyone else that has this issue should keep it enabled and consider trying to solve why the objects are staying in sleep rather than disabling the setting entirely.
2 Likes