using UnityEngine;
using System.Collections;

public class moveGhost : MonoBehaviour {

	public Transform playerOne;
	public Transform playerTwo;
	private Transform tar = null;
	public float speed;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		if (tar != null) {
			Destroy (gameObject, 5);
			gameObject.transform.position = Vector3.MoveTowards (transform.position, tar.position, speed * Time.deltaTime);
		}
	}

	void Player (float p){
		if (p == 1) {
			tar = playerOne;
		}else{
			tar = playerTwo;
		}
	}
}
