using UnityEngine;
using System.Collections;

public class DemonFriendControl : MonoBehaviour {
	public Transform PlayerFollow;
	public bool facingRight = true;
	public float speed = 1.0F;
	private float journeyLength;

	void Awake()
	{
		// Setting up references.
		PlayerFollow = transform.Find("/player_placeholder/PlayerFollow");
	}

	void Update() {
		journeyLength = Vector3.Distance(transform.position, PlayerFollow.position);
		float step = speed * journeyLength *Time.deltaTime;
		transform.position = Vector3.MoveTowards(transform.position, PlayerFollow.position, step);
		// If the input is moving the player right and the player is facing left...
	}
}
