using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VoodooRotate : MonoBehaviour {

    public float rotationSpeed = .5f;
    bool rotateCW = false;

    void Start()
    {
    }

	// Use this for initialization
	void FixedUpdate ()
    {
        

        if (transform.eulerAngles.y < 100)
            rotateCW = true;
        if (transform.eulerAngles.y > 230)
            rotateCW = false;
        if (rotateCW)
        {
            transform.Rotate(Vector3.forward * Time.deltaTime * rotationSpeed);
        }
        else
            transform.Rotate(-Vector3.forward * Time.deltaTime * rotationSpeed);

	}


    
}
