Scripting Errors
First off I am a total scripting noob, but i am getting an error CS1525 unexpected symbol "if" I realize this is commonly because of out of place braces but I dont know where i need to fix it. Also have a parsing error on that last } where I thought it should go, guess not. Any help?
using UnityEngine;
using System.Collections;
public class Select : MonoBehaviour {
public RaycastHit hit;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width/2,Screen.height/2,0))
if(Physics.Raycast(Ray, out hit, 10)) {
Debug.Log("Hit");
}
}
}
Comment
Answer by OncaLupe · Dec 08, 2015 at 03:12 AM
Missing semicolon on the ScreenPointToRay line (13 of the pasted code).
Usually when you see parsing error or unexpected symbol, the actual error is before the line shown in the error. Speaking of which, next time please paste the full error in the question, including line numbers. It helps find the problem.