hello everyone i am siting on the computer for a few hours and i cant get the Solution any way i need a script that i can control how many bullets i want to shoot this is the code that i have now:
var bullet : GameObject;
var GoodSpaceShip : GameObject;
function Start()
{
}
function Update()
{
if(Input.GetMouseButton(0))
{
ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if(Physics.Raycast (ray, rayCastHit))
{
transform.position.x = rayCastHit.point.x;
transform.position.y = rayCastHit.point.y;
Instantiate(bullet, transform.position, transform.rotation);
}
}
}
please help me ASAP thank you!