Question by
AquaBomber · Feb 28, 2016 at 09:17 AM ·
script error
Simple script error
Assets/allo.cs(16,24): error CS1525: Unexpected symbol `hover' Can someone help me, i have checked many times i don't get why this shoudn't work.
using UnityEngine;
using System.Collections;
public class allo : MonoBehaviour {
public float tiro;
bool hover;
// Update is called once per frame
public void Update () {
Ray pickup = new Ray (Camera.main.transform.position, Camera.main.transform.forward);
RaycastHit hitpoint;
if(Physics.Raycast (pickup, out hitpoint, tiro)
hover = true;
if (Input.GetKeyDown (KeyCode.E)) {
if(Physics.Raycast (pickup, out hitpoint, tiro)){
if(hitpoint.collider.tag == "fuel"){
Debug.Log("noob");
Destroy(hitpoint.collider.transform.gameObject);
}
}
}
}
public void OnGUI(){
if (hover) {
GUI.Box(Screen.width / 2 - 100,Screen.height / 2 - 100,150,20,"Press 'E' to pick up");
}
}
}
Comment
Best Answer
Answer by tanoshimi · Feb 28, 2016 at 09:23 AM
Line 15 is badly formed. You're missing a closing )
if(Physics.Raycast (pickup, out hitpoint, tiro)
Your answer
Follow this Question
Related Questions
transformers script error 1 Answer
After converting c# Script, Unity is giving errors on multiple lines which were fine before. 0 Answers
Need help with 4 scripting errors 0 Answers
Hi, I have two errors. I am sorry everyone but I am going crazy 1 Answer
Assets/Controller/Character Controller.cs(4,33): error CS8025: Parsing error 1 Answer