using UnityEngine;
using System.Collections;

public class MessageScript : MonoBehaviour {
	
	public string messageLine1 = "";
	public string messageLine2 = "";
	
	public float playerRange = 2.5f;
	
	private GameObject player;
	
	
	// Use this for initialization
	void Start () {
		player = GameObject.Find("Player");
	}
	
	// Update is called once per frame
	void Update () {
		if (Vector3.Distance(player.transform.position, transform.position)<2.5f){
			player.GetComponent<PlayerScript>().message = messageLine1 + "\n" + messageLine2;
			player.GetComponent<PlayerScript>().messageWipe = Time.time + 0.5f;
		}
	}
}
