Shooting by ship position - How?

Hello, i use this code to shooting.
But I need to bullet flew straight from the front of the SpaceShip like a picture1. How can i do it?
Thanks

`
using UnityEngine;
using System.Collections;

public class Bullets : MonoBehaviour {

public float speed;


void Start () {

    speed = 20f;

}

void Update() {

    Vector2 position = transform.position;

    position = new Vector2(position.x, position.y + speed * Time.deltaTime);

    transform.position = position;

    Vector2 max = Camera.main.ViewportToWorldPoint(new Vector2(1, 1));

    if (transform.position.y > max.y)
    {
        Destroy(gameObject);

    }
}

void OnTriggerEnter2D(Collider2D col)
{
        if (col.tag == "EnemyShip") 
        {
            Destroy(gameObject);

        }

    }

}

`

When you instantiate the bullet, you should use

transform.rotation

as the rotation argument of the Instantiate function. This will make the bullet spawn with the rotation of the SpaceShip (i assume, you are creating the bullets with a script attached to the space ship gameobject).

After this, you can use the same vector to move the bullet:

transform.Translate(transform.forward);

This will always move the bullet according to its rotation (which we have set previously to face in the correct direction).