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

public class launcherLook : MonoBehaviour
{
    public GameObject player;
    // public GameObject BarkBox;
    // public passerBy Persona;
    public Rigidbody lanza;
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        transform.LookAt(player.transform);
        transform.rotation*=Quaternion.Euler(-10, 1, 1);
        if (Input.GetKeyDown(KeyCode.L))
        {
            Rigidbody cha = Instantiate(lanza, this.transform.position, this.transform.rotation) as Rigidbody;
            // cha.velocity = (gameObject.transform.position - player.transform.position) * 2;
            // cha.AddForce(20 * transform.right, ForceMode.Impulse);
        }
    }

    public void launch(){
        Rigidbody cha = Instantiate(lanza, this.transform.position, this.transform.rotation) as Rigidbody;
    }
}
