Cylinder projectile seems to hit invisible wall, falls to the ground

I am creating a mission wherein the player must fire an arrow to hit on-coming opponents. It is important that he be able to fire in any direction, and it is important that the arrow’s nose point toward the opponent (as an arrow naturally would).

The problems:
1.) Originally, as I had made the arrow from a cylinder shape, it stood on end (nose to the sky). When fired, it traveled forward, on end. To fix this, I rotated the arrow, placing it inside another, empty game object, which preserved its new, horizontal rotation.

2.) Unfortunately, this created a second problem. Now, when fired, the arrow travels straight toward the ground. This makes sense. I rotated the arrow 90 degrees on the x axis. I didn’t rotate the direction of its velocity, which is evidently local, i.e. relative to the position of the arrow.

Here is the script on the arrow (which I found in another post in unityAnswers):

#pragma strict

static var gravity : Vector3 = Vector3.up * -9.81;
//Gravitational pull is always down.
var drag : float = 0.01;
//This is a coefficient, representing the force of drag on the projectile
var velocity : Vector3;
//Velocity represents both movement and speed.
var moving : boolean = false;

function Start()
{
 
}
 
function Update () 
{

 velocity += gravity;
 velocity -= velocity.sqrMagnitude * drag * velocity.normalized;
 var amountToMove = velocity * Time.deltaTime;
 transform.LookAt(transform.position + amountToMove);
 //This directs the arrow to point in the direction it has been aimed.
 transform.position += amountToMove;

I have changed Vector3.up to every other variable I see listed in the reference materials. I have changed “transform.position” to “transform.localPosition” and have attempted to use TransformDirection, though it has errored when I have done so. I’m not sure what else to do. I’d appreciate any pointers. Thanks.

I’ve figured out a solution to the problem: I scrapped the script above, which had been on the arrow, and applied the script below to the bow.

The crucial difference is the way I applied force to the arrow. I set the arrow’s velocity using “TransformDirection” which switched the coordinates from world to local, allowing the arrow to travel along its own, relative z axis, no matter in which direction along the world axes the player happens to be shooting.

#pragma strict
var canShoot : boolean;
var arrowPrefab : Rigidbody;
var linkToWEBowArrow : WEBowArrow;
var speed : float = 5000;

function Enable ()
{
 canShoot = true;
 //Upon entering the firing zone, the current script receives a call from the firing zone's script to call this function, which enables the player
 //to shoot an arrow.
}

function FixedUpdate () 
{
 if(Input.GetButtonDown("Fire1") && canShoot == true)
 {
 var arrow2 : Rigidbody = Instantiate(arrowPrefab, transform.position, transform.rotation);
 //The script instantiates an arrowPrefab at the location of the "Bow and Arrow" or the "Launcher" as it is called in the hierarchy. 
 arrow2.velocity = transform.TransformDirection(Vector3 (0,0,speed));
 //This script MUST use "TransformDirection" in order to convert the velocity coordinates from world space to local space. The arrow should 
 //travel on the z axis *relative to the arrow tip*. In other words, the arrow should always travel forward, into the screen, not up (y)
 //or across (x), regardless of which of the world coordinates (x,y,z) the player, and by extension the arrow tip, is pointing. Unfortunately, 
 //I do not know how to use TransformDirection with AddRelativeForce (i.e., in order to add relative force to an object along its own, local axes).
 //Here the script uses TransformDirection to specify its own Vector along the local axes.
 Physics.IgnoreCollision(arrow2.collider, transform.root.collider);
 //The IgnoreCollision method prevents the arrow from hitting the player's collider, which has been enlarged to register the approach of enemies.
 linkToWEBowArrow.Shoot();
 //Whenever the player fires his bow, the script sends a message to the white elf to fires his bow as well.
 canShoot = false;
 //The player may only shoot off one arrow per round. The script disables his shooting capacity after a single shot.
 }

}