Best way to implement a sliding cube, with the ability to ramp

Godot-4

I am trying to make a cube slide around a map that has bumps and ramps and barriers etc. I have created the main part where you drag back which generates power and then release and the cube shoots. However, the cube does not slide well over bumps or ramps. I am trying to implement smoother gameplay, I have played around with axis locks and damping but still its the same issue. The collision object is a cube the same size as the cube. I want the cube to take the angle of whatever surface its on, for example if the floor is angled tilted 25 degrees to the left, the cube should naturally have its base tilted at that angle to go along with the floor if that makes sense. I am just struggling.

Thanks

What is this cube? RigidBody? If so, give the collision shape rounded corners. It doesn’t collide very realistically (glass sliding on glass sort of way) with pointy corners.

I don’t understand the second part about degrees though. It makes it sound like it’s not a RigidBody and rather you’re doing the physics yourself. In which case, just rotate the cube accordingly?

The cube is a RigidBody3D. How would I go about rounding the corners?

I have sort of fixed the ramping problem. Meaning I wanted to align the base of the cube with whatever surface it is on. Example if there is a ramp of 15 degrees. I want the cubes base to align at 15 degrees. So I ended up coding this with a trace line to detect the surface and seems to work okay for now.

Any idea if I should look at collisionshapes with friction? I am considering this for my cube.

Not sure you can round the corners of a collision cube… You’d have to use other shapes or multiple shapes, like box in the center and polygon at the edges. Well, that’s what I’d do, but I don’t know of a better way. Since you’re doing 3D, did you try the Jolt engine if it handles it any differently?

I was simply wondering about the ramp problem because I’d assume the physics engine to do that for you. I don’t know what the default friction is, but you should definitely put a physics material on the cube and the surfaces to reduce the friction and see how it works.