xxxxxxxxxx
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class helpscript : MonoBehaviour {
Transform t;
public float fixedRotation = 5;
void Start () {
t = transform;
}
void Update () {
t.eulerAngles = new Vector3 (t.eulerAngles.x, fixedRotation, t.eulerAngles.z);
}
}
For more info -- https://answers.unity.com/questions/1302697/how-to-lock-the-rotation-of-an-object.html