Hello, my names Avo. Ive been working on learning scripting in Unity by creating a few simple scripts so i can pick up syntax. Ive run into a few problems while trying to create a script that swings a stick though, the line marked in red is the one im having trouble with.
The error im having is (23,25): BCE0044: expecting :, found ‘}’.
The script is a java script.
var swinging:boolean=false;
var swinglocation=0;
function Update ()
{
//Check if the player wants to swing his weapon.
if (!swinging)
{
if (Input.GetMouseButtonDown(0))
{
swinging= true;
}
}
//Swing the weapon
if (swinglocation < 5)
{
if (swinging)
{
swinglocation += 1;
{
[COLOR="red"] transform.Rotate(Vector3.right * Time.deltaTime);[/COLOR] }
}
}
}
Thanks! I knew i was doing somthing stupid like that! Thats really helpfull! I found another problem thats still baffling me though!. I know its another minor little syntax problem like that though…
transform.Rotate(Vector3.right * Time.deltaTime);
seems to be giving me the error
(23,25): BCE0044: expecting :, found ‘}’.
And once again, thanks for the incredibly speedy response
var swinging:boolean=false;
var swinglocation=0;
function Update ()
{
//Check if the player wants to swing his weapon.
if (!swinging)
{
if (Input.GetMouseButtonDown(0))
{
swinging= true;
}
}
//Swing the weapon
if (swinglocation < 5)
{
if (swinging)
{
swinglocation += 1;
{
[COLOR="red"] transform.Rotate(Vector3.right * Time.deltaTime); [/COLOR] }
}
}
}
Found the problem! I new it was some stupid little syntax error on my part! I had an extra set of brackets from previous work i had done to the code i forgot to take out.