How to make a ball capable of rolling around a loop the loop?

Hello to all. In my game, I want the ball player object to go around a loop the loop like a hotwheels car. I knew that rb.addForce() wouldn’t work, since it pushes the ball in one direction corresponding to the key pressed, therefore just ending up pressing against the wall halfway up. Instead, I tried rb.addTorque, but I ran into a problem with that as well, since the different axis turn as the ball does. I think I’ll have to make it so that the axis of the ball stays relative to the world, therefore guaranteeing that it will spin in the desired direction, but I have no idea how. If anyone knows or has a better solution, I would be very grateful. Thanks!

You could possibly try adding a force in the direction the ball is currently moving, that should work. You can access that direction from rb.velocity. I guess you should normalize the vector, so the amount of force added doesn’t grow with the current speed.