using UnityEngine;
using System.Collections;

public class ParallaxScript : MonoBehaviour {

    public float speed = 10.0F, radius = 5.0F;
    private float centreY, centreZ;

    void Start()
    {
        Vector3 position = transform.position;
        centreY = position.y * 0.5F;
        centreZ = position.z * 0.5F;
    }

	void Update () {
        float time = Time.time;
        float angle = time * speed;
        transform.position = new Vector3(transform.position.x, ((centreY + Mathf.Cos(angle) * radius)), (centreZ + Mathf.Sin(angle) * radius));
    }
}
