- Home /
Unity EOF error!
i am working on a unity game and the really anoying error keeps coming up! the error is Assets/Melee_System.js(4,23): BCE0044: expecting EOF, found '1.5'.
here is my code
#pragma strict
var Damage : int; 50;
var Distance : float; 1.5
:melee
if input GetMouseButtonDown goto raycast;
:raycast
Raycast, Raycast.distance, goto damage;
:damage
if Raycast.distance, Damage;
can sombody please help me?
I formatted for you. You can do this using the "101010" button. btw what is this
Did something get lost in the formatting? This doesn't even look like code...
What program$$anonymous$$g language is that even supposed to be?
You can't just make up your own syntax as you go and expect the compiler to figure it out.
It's Fluffy$$anonymous$$asterScript, version 1.0. No idea why Unity doesn't support it.
Answer by Kiloblargh · Jul 14, 2013 at 09:03 PM
#pragma strict
var damage : int = 50;
var distance : float = 1.5;
function Melee()
{
if (Input.GetMouseButtonDown(0))
{
RayCast();
}
}
function RayCast ()
{
var hit : RaycastHit;
if (Physics.Raycast (Camera.main.ScreenPointToRay (Input.mousePosition), hit, distance ) )
{
Damage (hit.distance);
}
}
function Damage (rayDistance : float)
{
Debug.Log (damage / rayDistance+"This wasn't going to do anything anyway.");
}
Here is my best attempt at translating the pseudocode you posted from facepalm to unityJS.
I advise you put aside Unity for a few months and just learn how to write a script the right way.
("EOF expected" means the compiler was telling you; "just stop already!")
Thank you $$anonymous$$iloblargh it helped a lot! ☺
Your answer
Follow this Question
Related Questions
Error BCE0044 plz help 0 Answers
sript gets error 2 Answers
expecting EOF, found 'showOptions' 1 Answer
BCE0044: expecting EOF, found }` error In my scripy 2 Answers
Javascript Expecting Errors ';' & '=' 0 Answers