my ray cast is only shooting out a few meters no matter the distance.

my ray cast is only shooting out a few meters no matter the distance. currently distance is at a 1000 units( i should say) the pic is yellow is he ray cast line drawn. the second pc i believe it is in blue

[8971-screen+shot+2013-03-15+at+11.44.03+am.png|8971]

I have a function and it has been assigned to the update function. when i debug it, it does tell me that the range is current at 1000, but the ray only shoots a few meters. below is the function, and below that is the update function that may or may not be temporary. although the function ShootContrllor is displayed first, it is actually below, a few other functions down.

please be advised that i watched the unity answers video, and i have done accordingly. please do the same and remember this is unity answers and not unity forum. In particular pointing me to some reference on raycasting, or …you know.

public void ShootController()
	{
		

				currentWeapon.shotTimer = Time.deltaTime + currentWeapon.firerate;
				Debug.Log("I shot");

			
				RaycastHit hit;
				if(Physics.Raycast(currentWeapon.SpawnPoint.position, currentWeapon.SpawnPoint.TransformDirection(Vector3.forward), out hit,currentWeapon.weaponRange))
				{
					Debug.DrawRay(currentWeapon.SpawnPoint.position, currentWeapon.SpawnPoint.TransformDirection(Vector3.forward),Color.blue,currentWeapon.weaponRange);
					
					if(hit.collider.gameObject.name == GameObject.FindWithTag("HeadCollider").gameObject.name)
					{
						Debug.Log("I hit the Head");	
						Debug.Log("Range is" + currentWeapon.weaponRange);
					}
					else if(hit.collider.gameObject.name == GameObject.FindWithTag("BodyCollider").gameObject.name)
					{	
							Debug.Log("I hit the Body");	
							Debug.Log("Range is" + currentWeapon.weaponRange);
					}
					else
					{
						Debug.DrawRay(currentWeapon.SpawnPoint.position, currentWeapon.SpawnPoint.TransformDirection(Vector3.forward),Color.yellow,currentWeapon.weaponRange);
					    //Debug.Log("I hit something");
					}
				

			}

		
	}

public void Update()
{
	if(currentWeapon.shotTimer > 0)
	{
		currentWeapon.shotTimer -= Time.deltaTime;	
	}
	
	if(currentWeapon.shotTimer < 0)
	{
		currentWeapon.shotTimer = 0;	
	}
	
	if(Input.GetMouseButtonDown(0) && currentWeapon.bulletsLeft > 0)
	{
		if(currentWeapon.shotTimer == 0)
		{
			ShootController();	
			
		}
		
		Bullets();
		
	}
	

	
}

Here is your error:

Debug.DrawRay(currentWeapon.SpawnPoint.position, currentWeapon.SpawnPoint.TransformDirection(Vector3.forward),Color.yellow,currentWeapon.weaponRange);

You are drawing a ray that is only 1 unit long (Vector3.forward is a unit vector).

Please see the script reference: