Hey there I can’t seem to get my bullet to spawn in front of my player, then apply the force. I’m doing a top down space shooter but the object creates inside my ship and also doesn’t go straight. It goes off to the left instead of forward. Here’s my current code. Hope you guys can help.
var Bullet : Transform;
function Update ()
{
if(Input.GetButtonDown("Fire"))
{
Instantiate(Bullet,transform.position, Quaternion.identity);
Bullet.rigidbody.AddForce(transform.forward * 15);
}
}