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");
}
}
}
}