Bullets Based on Orientation

So I’m trying to set up a system where I have “GunNodes” which spawn bullets and fire them in the direction that the nodes are facing. So far, I’ve been having some trouble.

BulletCode:

  function Update () {
LifeTime += Time.deltaTime;
transform.position += Vector3.forward * BulletSpeed * Time.deltaTime;
if(LifeTime >= Range){
	Destroy(gameObject);
}

GunCode:

function FireGuns (){
			FiringCoolDown = true;
			Instantiate(BulletObj, GunNode.position, GunNode.rotation);
			Handheld.Vibrate ();
			yield WaitForSeconds(FireRate);
			FiringCoolDown = false;
}

Particularly, how can I spawn an object and cause it to move in the direction that another object is facing?

In your bullet code, change this line:

transform.position += Vector3.forward * BulletSpeed * Time.deltaTime;

to this:

transform.Translate(Vector3.forward * BulletSpeed * Time.deltaTime, Space.Self);

Keep in mind that bullets that move in this way will not respond to colliders, or in fact any kind of collision detection. You will have to add a second step that sends a linecast between the bullet’s position before and after the translation to manage collisions.