Turret bullet rotation problem

i've been stock on this for a like 2-3 days, i have a turret that instantiate a bullet prefab at the player every second within range, i want the bullet to face the player which doesnt. btw this is a 2D sidecroller, i've tried a 100 things that doesnt work..

the turret is compose of a base and the part that shoots and point towards the player as a child object

(the bullet's rotation seems to shoot according to the base's rotation which is not i what i want, i think only the z rotation should be facing the player) here's some of my code so far:

***this script is attached to the turret base:

Instantiate(TurretBullet, transform.position, transform.rotation);

***and then ths script is attached to the bullet prefab:

var projectileSpeed : float = 10;

var bulletMove : float;

var targetObj : GameObject;

function Update () {

    bulletMove = projectileSpeed * Time.deltaTime;
    transform.position += transform.forward * bulletMove;
}

still needs some help plz.

Your instantiate command is causing the bullet to inherit the rotation of the base by telling it to use transform.rotation. Instead you'll want to calculate the rotation needed to point the bullet at the player. Try the following where target is the player.

Vector3 relativePos = target.position - transform.position;
Quaternion newRotation = Quaternion.LookRotation(relativePos);
Instantiate(TurretBullet, transform.position, newRotation);