- Home /
Question by
Strangerz · Dec 10, 2013 at 03:26 AM ·
errorerror message
Why Can't I Fix This Error In My Script?
I keep getting the same error: "Assets/MeleeSystem.js(3,21): UCE0001: ';' expected. Insert a semicolon at the end." How do I fix it? This is the script I'm using:
#pragma strict
var TheDammage : int - 50;
var Distance : float;
function Update ()
{
if (Input.GetButtonDown("Fire1"))
{
var hit : RaycastHit;
if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit))
{
Distance = hit.distance;
hit.tranform.SendMessage("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver);
}
}
}
Comment
Answer by stuartcarnie · Dec 10, 2013 at 04:34 AM
Line 3, I suspect you intended the -
to be =
as follows
#pragma strict
var TheDammage : int = 50;
var Distance : float;
// etc
Answer by robertbu · Dec 10, 2013 at 04:05 AM
On line 3, the minus sign should be an equals sign:
var TheDammage : int = 50;
You also left out the 's' in 'transform' on line 14.
Your answer
Follow this Question
Related Questions
Help please guys thank you so much! 1 Answer
Monodevelop Fatal Error 0 Answers
NullReferenceException on empty project because of ScriptCompilerBase 0 Answers
Inspector Error 1 Answer