- Home /
BCE0044 and UCE0001 Problems In My Script ! Pleeeease Help !
Hi !
This My Script
#pragma strict
var FullHealth : int = 100;
var CurrentHealth : int = FullHealth;
function Start ()
{
print("Health = " + CurrentHealth);
}
function HealthAdjust ()
{
if (CurrentHealth >= 1)
{
print("Health = " + CurrentHealth);
}
else
{
Kill();
}
if (CurrentHealth > FullHealth)
{
CurrentHealth = FullHealth;
}
if (0 > CurrentHealth)
{
CurrentHealth = 0;
}
}
function OnCollisionEnter (hit: Collision)
{
if (hit.gameObject.tag == "Bullet")
{
HealthAdjust (-2);
}
else if (hit.gameObject.tag == "Laser")
{
HealthAdjust(-10);
}
else if (hit.gameObject.tag == "Small Missile")
{
HealthAdjust (-25);
}
else if (hit.gameObject.tag == "Medium Missile")
{
HealthAdjust (-50);
}
else if (hit.gameObject.tag == "Big Missile")
{
Health Adjust (-75);
}
else if (hit.gameObject.tag == "Water")
{
HealthAdjust (-100);
}
else if (hit.gameObject.tag == "Small Pack")
{
HealthAdjust (25);
}
else if (hit.gameObject.tag == "Medium Pack")
{
HealthAdjust (50);
}
else if (hit.gameObject.tag == "Big Pack")
{
HealthAdjust (100);
}
function Kill ()
{
Destroy (gameObject)
}
And These Are The Problems Which I Face
Assets/Scripts/PlayerHealth.js(79,10): BCE0044: expecting (, found 'Kill'. Assets/Scripts/PlayerHealth.js(57,23): UCE0001: ';' expected. Insert a semicolon at the end. Assets/Scripts/PlayerHealth.js(79,17): UCE0001: ';' expected. Insert a semicolon at the end. Assets/Scripts/PlayerHealth.js(81,29): UCE0001: ';' expected. Insert a semicolon at the end. Assets/Scripts/PlayerHealth.js(83,1): BCE0044: expecting }, found ''.
Pleeeeeeeeeeeeease Help
Thanks For Reading
Answer by Akira_san · Jan 26, 2014 at 03:27 PM
I see that you have "Health Adjust" and "HealthAdjust" could that be it?
Answer by GameVortex · Jan 27, 2014 at 01:54 PM
Function OnCollisionEnter is missing its closing bracket: }
Your answer
Follow this Question
Related Questions
3 java errors on a basic shooting script? 2 Answers
Unity to Iphone Unity iPhoneTouchPhase.Ended problems 2 Answers
Expecting EOF Found } 3 Answers
Three errors in my project, PLEASE HELP! 1 Answer
UnlitAlpha shader script not working 1 Answer