Hello I have a small problem and already looked at other threads with no luck. I have a ship that by pressing the space bar it shoots a missile from a spawn point(empty object) that i have created in front on the ships nose. Now my problem is when the ship is rotated and i fire a missile the missile’s nose wont look where it is supposed to look. For instance i might shoot and the missile’s front direction is the back of the missile and not the nose. With a few words the missile will always look at certain direction no matter where the ship is looking at.
I have set the object to local space already.
Any suggestions? Thanks
The script that is attached to the boat :
var bulletPrefab:Transform;
var speed = 2000;
function Update () {
if(Input.GetButtonDown(“Jump”))
{
var bullet = Instantiate(bulletPrefab, transform.Find(“SpawnPoint”).transform.position,
Quaternion.identity);
bullet.tag =“vehicleProjectile”;
bullet.rigidbody.AddForce(transform.forward * speed);
}
}