Object started tumbling,

Hello, I’m just learning Unity, I created a player object which is traveling/sliding on a level ground, ground has 0 friction, it worked perfectly, now I added some obstacles and stuff on the ground, and the player started to tumble all of a sudden, I didn’t change anything in code regarding to player movement, I can’t find anything that might be the problem.

Here is the player movement code:

using UnityEngine;

public class PlayerMovement : MonoBehaviour

{

public Rigidbody rb;

public float forwardForce = 2000f;
public float sidewaysForce = 500f;
public float upwardForce = 50f;

// Update is called once per frame
void FixedUpdate()
{
    rb.AddForce(0, 0, forwardForce * Time.deltaTime);

    if (Input.GetKey("d") )
    {
        rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
    }

    if (Input.GetKey("a") )
    {
        rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
    }

    if (Input.GetKey(KeyCode.Space))
    {
        rb.AddForce(0, upwardForce * Time.deltaTime, 0);
    }
}

}

You could freeze the x y or z rotation if it is a rigidbody. These will be at Rigidbody>Constraints in your inspector tab. If you do want the object to be able to tumble at a different point, you can do this in the code by doing:

Rigidbody.constraints = RigidbodyConstraints.FreezeRotation; (Freeze)

Rigidbody.constraints = RigidbodyConstraints.None; (Unfreeze)

Thank you, but I just booted up the project and the player object is not tumbling any more. WTH?

Thanks for the answer anyway.