Enemy attack the player ?

Hello

I created an enemy to attack a player, this enemy has a gun. I want when this gun shot, the shot goes to direction of player. I can instantiate bullet of gun but can’t change direction bullet to attack my player in his position.

how can I do this ?

I’m trying this.

public class EnemyShotGun : MonoBehaviour {

    public GameObject[] gun; //gun attack player
    public GameObject prefabShot; //shot
    public float enemyShotSpeed;
    private float delayAttack; 
    public float timeAttack; 

    //player
    private Transform player;

	// Use this for initialization
	void Start () {
	    player = GameObject.FindGameObjectWithTag("AirPlane").transform;
	}
	
	// Update is called once per frame
	void Update () {
        delayAttack += Time.deltaTime;
        if (delayAttack >= timeAttack){            
            for(int x = 0; x < gun.Length; x++){
                GameObject shot = Instantiate(prefabShot, gun[x].transform.position, Quaternion.identity) as GameObject;
                shot.rigidbody2D.AddRelativeForce(new Vector2(0, -500)); 
                shot.transform.position = player.position; //bullet goes player position
            }                        
            delayAttack = 0;
        }
	
	}
}

I solved the problem now works !

I did

// Update is called once per frame
	void Update () {
        delayAttack += Time.deltaTime;
        if (delayAttack >= timeAttack){            
            for(int x = 0; x < gun.Length; x++){
                GameObject shot = Instantiate(prefabShot, gun[x].transform.position, Quaternion.identity) as GameObject; 
                //shot goes player               
                shot.rigidbody2D.AddRelativeForce((player.position - shot.transform.position) * 60);                              
            }                        
            delayAttack = 0;
        }
	
	}