using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ProjectileScript : MonoBehaviour {

    Transform target;
    Transform target2;

    Vector3 Direction;
    Vector3 NormalizedDirection;
    void Start() {
        
        target = GetComponentInParent<BossFSM>().targetPlayer.transform;
        target2 = target;

        //  this.transform.LookAt(target);
        Quaternion LookAt = Quaternion.LookRotation(transform.position - target.transform.position);
        //LookAt.x = 0;
        //LookAt.y = 0;
        
        // transform.rotation = LookAt;    
        Direction = target2.position - transform.position;
        NormalizedDirection = Direction.normalized;

    }

    void Update() {
        // this.transform.LookAt(target);
        // this.transform.position = Vector3.MoveTowards(this.transform.position, target2.position, 3 * Time.deltaTime);

        transform.position += NormalizedDirection * 8* Time.deltaTime; //APLIPHY
    }
}
