How to rotate a sphere from its center while moving

Right now I am trying to make it so that my sphere moves forward while rotating, like a ball rolling down a hill. So I made a script for it to roll and move.

function Update () {
transform.Translate(Vector3(-10,0,0) *
Time.deltaTime);
transform.Rotate(Vector3(0,0,-10) *
Time.deltaTime); }

Now if the ball is not moving, the rotation of the ball is at its center, but if the ball is moving, it just does a giant loop while moving. Does anybody know a solution to this? Thanks.

I’m suspecting that you are rotating the ball in the world coordinates. You should try to rotate it in the local coordinates instead:

transform.Rotate((Vector3(0.0f, 0.0f, -10.0f) * Time.deltaTime), Space.Self);

Good luck!

Space.Self was important but I also had to make a parent object that wouldn’t be affected by rotation and have the child of it be the one to rotate. I wasn’t able to have the same object move and rotate without it losing its center as the pivot. Not a big issue.