Instantiate bullet hitting me when accelerated

hi all, i need help with this, it confuses me.
i have ship with weapon that shoot bullet front of ship, all is ok unless i move then bullet hit me. i don’t know why doing it because when bullet is created it have speed bigger how ship but it look like position where the bullet is created is closer to ship with increasing speed. here is script what i use.

#pragma strict

var my_pos : Transform;		
var ammo : GameObject[];
static var spawnDelay = 0.1f;
var time = 0f;
static var Pspeed = 0f;

function Start () {

}

function Update () {

}

function FixedUpdate () {
	time += spawnDelay;
	if(Input.GetKey(KeyCode.Mouse0)){
		if(time > 1){
			var ammoIndex = 0;
			var bullet : GameObject = Instantiate(ammo[ammoIndex], transform.position, transform.rotation) ;
			bullet.transform.LookAt(my_pos);
			bullet.transform.rotation = transform.rotation;
			bullet.rigidbody2D.velocity = transform.up * Pspeed; //i added here player speed because i dont want to be faster how bullet.
			time = 0;
		}
	}
}

this is weapon script it create bullet front of me(weapon is empty gameobject added to front of my ship and there is bullet created).

#pragma strict

var bulletSpeed : float;

function Start () {
	
}

function Update () {
	Destroy(gameObject,1.2);
	transform.Translate(Vector3.up * bulletSpeed * Time.deltaTime); //and this is basic speed of bullet.
}

function OnCollisionEnter2D(){
	Destroy(gameObject);
}

and this is bullet.

Here are my thoughts on the problem.

  1. Use Update(), instead of FixedUpdate() to spawn your bullet.

Why? Because of execution order of physics and game logic. FixedUpdate is within physics update, where as Update() is after. You can see execution order here: Unity - Manual: Order of execution for event functions

  1. Set rigidbody2d.velocity on instantiation and not both velocity and translate.

  2. Set OnDestroy on instantiation and not in Update(). Once will suffice.