i am making a script and it says
Assets/My Stuff/scripts/TurretControl.js(42,15): UCE0001: ‘;’ expected. Insert a semicolon at the end.
the script part it says it on
function DoDamage()
{
Player Health.HEALTH -=1;
}
please help
i am making a script and it says
Assets/My Stuff/scripts/TurretControl.js(42,15): UCE0001: ‘;’ expected. Insert a semicolon at the end.
the script part it says it on
function DoDamage()
{
Player Health.HEALTH -=1;
}
please help
You need to remove the space between Player and Health, that makes it look like 2 different commands.
Note: Let me warn you now that your static variable HEALTH will cause you problems, you should change to using an instance variable and instead use FindObjectOfType() to get the instance then access the variable that way.
Pro tip (again): The numbers in the brackets in the error tell you the line number and column number where the compiler encountered the error. Double-clicking the error message should take you to the exact line with the problem. Then it’s just a case of figuring out what the compiler is telling you.