Stop rotating after falling down

Hello, a newbie here.

Learning C#, while expermenting on Unity. so I created Sphere as a game object. and it can ride on a platform. if, he falls down, i want him to get back on the screen and take one life out, as normal in most games. but, because it’s a sphere, after he falls, his rotation goes crazy. and i don’t really know how to set it up to 0.0.0 after I “revive” my player.

if (transform.position.y < die && lives > 0)
{
    transform.position = new Vector3(0, 3, 0);
    //transform.Rotate(0, 0, 0); <- doesnt work..
    lives--;
}

big mistake i could have avoided. rotate and other code worked incorrectly because i put it in the if. now i just added

transform.rotation = Quaternion.identity;

above if statement and it woprks perfectly! :slight_smile: