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.