- Home /
Scripting Error! - UCE0001: ';' expected. Insert a semicolon at the end.
Hi, I'm getting an error that says:
Assets/MeleeSystem.js(5,17): UCE0001: ';' expected. Insert a semicolon at the end.
Here is my code:
#pragma strict
var Damage : int - 50; //Creates a variable called damage which is equal to an integer (50)
var Distance : float;
function Update () // Calls an update function to check for a keypress
{
if (Input.GetButtonDown("Fire1")) //Checks for fire1, for fire button
{
var hit : RaycastHit; //Sends out a line
if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit)) // if line hits an object, return information
{
Distance = hit.distance; //checks distance of line
hit.transform.SendMessage("ApplyDamage", Damage, SendMessageOptions.DontRequireReceiver); //sends a message to object to apply damage
}
}
}
Sorry if this is formatted wrong or whatever, it's my first post on this site.
Thanks =)
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Script error help! 1 Answer
Selecting Object From Top Causes NullReference 1 Answer
Nested Functions 1 Answer
Removing dead bodies, big lag issue. 2 Answers