- Home /
SemiColon At The End,Expecting Found /N? Help!
I got 2 errors that says expected insert a semicolon at the end and expecting found /n. Help Please!
#pragma strict
var TheDamage : int 50;
var Distance : float;
Function Uptade () '
{
if (Input.GetMouseButtonDown("Fire1"))
{
var hit : RaycastHit;
if (Physics.Raycast Transform.position, Transform.TransformDirection(Vector3.forward), hit))
{
Distance = hit.distance;
hit.transform.SendMessage("ApplyDamage"), TheDamage, SendMessageOptions.DontRequireReceiver);
}
}
}
Answer by Dave-Carlile · Jul 13, 2015 at 02:27 PM
var TheDamage : int = 50; <-- you need the equal sign
Change function Uptade()
to function Update()
, and you have a quotation mark at the end of that line that you need to remove.
Good luck!
Thanks the first problem worked but line 6 does not and in i remove the quotation mark at the end i get like 11 errors
I had Upgrade
as your function name but it should be Update
. Can't help you with the new errors if you don't show them.
Having that quotation mark where you had it made the compiler think everything that came after it was a string. Once you removed it it's going to try to compile what it sees. You apparently have some additional code that you need to fix.
Your answer
![](https://koobas.hobune.stream/wayback/20220611231113im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Expecting EOF found '}' (IM SO LOST) 1 Answer
Is this "scene switcher" script set up the right way? 1 Answer
Why isn't my teleport on collision script working? 0 Answers
Building on android. 1 Answer