using System.Collections; using System.Collections.Generic; using UnityEngine; public class modelsRotate : MonoBehaviour { public GameObject rotate; bool onRotate = false; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (onRotate) { rotate.transform.Rotate(0, .3f, 0, Space.Self); } } public void modelRotate() { if (onRotate) { onRotate = false; } else { onRotate=true; } } public void closeRotate() { onRotate = false; rotate.transform.localEulerAngles = new Vector3(0,141,0); } }