Im trying to setup a tranportation script... basically when a player gets near a boat or something like that it shows this GUI and once they hit the button it transports them to the designated positions which are variables... Im using a C# script and this is it
using UnityEngine;
using System.Collections;
public class Transportation : MonoBehaviour {
public string Message;
public int ScreenWidth;
public int ScreenHeight;
public int TeleX;
public int TeleY;
public int TeleZ;
private Vector3 TransportTo;
void OnGUI() {
Transport();
}
private void Transport() {
if(GUI.Box(new Rect((ScreenWidth - 10), (ScreenHeight - 10), 150, 75), "") {
TransportTo = new Vector3(TeleX, TeleY, TeleZ)
}
GUI.Label(new Rect(ScreenWidth, ScreenHeight, 100, 20), Message);
GUI.Button(new Rect((ScreenWidth + 27), (ScreenHeight + 25), 100, 20), "Go!");
}
}
This is the error i get
Assets/My Assets/Scripts/Transportation.cs(21,92): error CS1525: Unexpected symbol `{'
Its hard for me to explain because i know what the error means but i dont know how to fix them... sorry...
Its most likely some simple thing that i am missing but if it is than please point it out and tell me how to fix...