Cant find the error!

Hey guys I can’t seem to figure out what is wrong with this simple script. I am getting an error that I need to insert a semi colon and there is one…It’s line 14 that shows the error.

function Update () {

var hit : RaycastHit;
var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition); 

if (Input.GetMouseButtonDown(0))
{
if (Physics.Raycast(ray, hit, 100))

{ 
	
	if (hit.transform.tag == "Enemy Sphere")
	{
		var posSphere : Vector3(Random.Range(-15 , 15), Random.Range(-3, 3), 0);
		hit.transform.position = posSphere;
		print ("You hit Sphere");
	
	}
	
	if (hit.transform.tag == "Enemy Cube")
	{ 
		print("You hit Cube");
	}

}
}
}

Think I found it, needs to look like this:

var posSphere : Vector3 = Vector3(Random.Range(-15 , 15), Random.Range(-3, 3), 0);

I am following a tutorial and the guy’s code looks like mine posted above, the incorrect way. Why does it work for him in the video? Does Unity change the way these functions work from time to time? Maybe the guy in the tutorial is using an older version?

That wouldn’t work anywhere, he may have used

var posSphere = Vector3 (...);

though.

rmele09’s solution is also good. It’s actually even faster.

oh yea I see what you mean. Thanks guys for the responses, seems to be working now.