- Home /
C# Script error (error CS8025: Parsing error)
Hi Everyone, i have problem in my c# script, and it's :
(Assets/Scripts/NewBehaviourScript.cs(3,26): error CS8025: Parsing error)
please help me to solve it
My Script :
public Texture Boot Normal;
public Texture Boot Hover;
void Update ()
{
if (Boot Normal.HitTest(Input.GetTouch(0).position))
{
}
if(Input.GetTouch(0).phase==TouchPhase.Began)
{
GUITexture : Boot Normal
}
if(Input.GetTouch(0).phase==TouchPhase.Stationary)
{
GUITexture : Boot Hover;
}
if(Input.GetTouch(0).phase==TouchPhase.Moved)
{
GUITexture : Boot Hover;
}
if(Input.GetTouch(0).phase==TouchPhase.Ended)
{
Application.LoadLevel("boot1");
}
{
}
}
This script has problems...
1) You cannot have spaces in the names of variables, so 'Boot Normal' should be 'BootNormal'
2)
if (Boot Normal.HitTest(Input.GetTouch(0).position)) { }
This code does nothing at all as shown by empty braces [ { } ]. Equally the braces at the end also do nothing.
Also HitTest is not a method of Texture, did you mean GUITexture? http://docs.unity3d.com/ScriptReference/GUITexture.html
You're new to scripting, but you need to do some basic tutorials first before copying other people's code and trying to get it to work. Try here ins$$anonymous$$d:
http://unity3d.com/learn/tutorials/modules/beginner/scripting