using UnityEngine;
using System.Collections;

public class swing : MonoBehaviour {

    public float time;
    private float angle = 45;

    private Quaternion defaultRotation;

    // Use this for initialization
    void Start () {
        time = 0;
        defaultRotation = transform.rotation;
    }
	
	// Update is called once per frame
	void Update () {

        transform.Rotate(Vector3.left * Mathf.Cos(time) * 1);

        time += 0.025f;

    }

    public void ResetRotation()
    {
        transform.rotation = defaultRotation;
    }
}
