- Home /
SemiColon At The End and Found /n Errors! Help!
#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);
}
}
}
I get 2 errors that says expecting semicolon at the end and expecting found /n PLEASE HELP!
Three things: 1) Function should be function (lowercase f). 2) Uptade should be Update (t and d the wrong way round). 3) At the end of that line you have an apostrophe which shouldn't be there
Answer by tanoshimi · Jul 14, 2015 at 09:47 AM
Programming requires attention to detail; your code is littered with errors.
var TheDamage : int 50;
- syntax matters.Function
- capitalisation matters.Uptade()
- spelling matters.'
- commenting out your entire function matters.if (Physics.Raycast Transform.position...
- commas matter.hit.transform.SendMessage("ApplyDamage"), TheDamage...
- brackets matters.
Your answer
Follow this Question
Related Questions
';' Expected, Tried everything. How do I do this? 1 Answer
How to make a Day/Night Cycle? 2 Answers
Setting Scroll View Width GUILayout 1 Answer
; expected insert semicolon at the end 2 Answers