﻿using UnityEngine;
using System.Collections;

public class PlatformMover : MonoBehaviour {

	public float speed = 1.0f;
	public float range = 1.0f;

	public Vector3 move = new Vector3 (0f, 0f, 0f);

	Vector3 start;
	// Use this for initializations
	void Start () {
		start = transform.position;
	}
	
	// Update is called once per frame
	void Update () {
		transform.position = start + move * (Mathf.Sin (Time.fixedTime * speed) * range);
	}
		
	void OnTriggerEnter(Collider other) {
		other.transform.SetParent (transform);
	}

	void OnTriggerExit(Collider other) {
		print (other.tag);
		other.transform.SetParent (null);
	}


}
