Question by
szymixooo · Oct 24, 2015 at 09:24 PM ·
compile-error
Help me with error CS1525: Unexpected symbol `the'
Help me with error CS1525 : Assets/Skrypty/Ekwipunek.cs(2,21): error CS1525: Unexpected symbol `the'
Pls help, where is problem ?
function Start () {
-- Select the first weapon
SelectWeapon(0);
}
function Update () {
-- Did the user press fire?
if (Input.GetButton (-Fire1-))
BroadcastMessage(-Fire-);
if (Input.GetKeyDown(-1-)) {
SelectWeapon(0);
}
else if (Input.GetKeyDown(-2-)) {
SelectWeapon(1);
}
}
function SelectWeapon (index : int) {
for (var i=0;i-transform.childCount;i++) {
-- Activate the selected weapon
if (i == index)
transform.GetChild(i).gameObject.SetActiveRecursively(true);
-- Deactivate all other weapons
else
transform.GetChild(i).gameObject.SetActiveRecursively(false);
}
}
Comment
Answer by Statement · Oct 24, 2015 at 09:46 PM
Your "comments" --
should be //
For example...
-- Select the first weapon
... should be...
// Select the first weapon
And then you got some weird -1-
stuff in there. It's not code. It's some cute comment or placeholder someone put there, or you copied text from somewhere and got the markup code. Most likely it should be "1"
Finally, it's not C#, it's JavaScript. Change the file extension to .js