I am having issues with rotating the player. I know this is simple but kindly have a look. You will be flabbergasted.

I am following Space Shooter tutorial and the player doesn’t rotate but when I uncomment ‘Debug.Log (rb.rotation);’ the player starts rotating. I had implemented this game earlier on older version of unity and it worked. It seems that this issue is related to new version of unity. Also the player stays in rotated orientation when I hard code the angle

    private Rigidbody rb;
public float speed;
public float tilt;
public Boundary boundary;

// Use this for initialization
void Start () {
	rb = GetComponent<Rigidbody> ();

void FixedUpdate(){
	float moveHorizontal = Input.GetAxis ("Horizontal");
	float moveVertical = Input.GetAxis ("Vertical");

	// move player
	Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
	rb.velocity = movement * speed;
	// restrict the player from going out of playing area
	transform.position = new Vector3 (
		Mathf.Clamp (transform.position.x, boundary.xMin, boundary.xMax),
		Mathf.Clamp (transform.position.z, boundary.zMin, boundary.zMax)

	// rotate the player based on velocity along X axis
	//Debug.Log (rb.rotation);
	rb.rotation = Quaternion.Euler (0.0f, 0.0f, rb.velocity.x * -tilt);

You are performing tasks in FixedUpdate which should be in Update… that is everything that is not directly Physics.

Debug.Log is intensive and is likely slowing things down enough for your FixedUpdate control method to actually be detected. I’m guessing, there’s no other reason that I can think of that Debug.Log would affect things in this way.

This line from the docs may be key :

“If you change the rotation of a Rigidbody using Rigidbody.rotation, the transform will be updated after the next physics simulation step.” So it could be just a timing issue.