Hello can you please help me find error because i can’t seem to find the parsing error,
this is my code.
ps. the code does work for some people and with me doesn’t can you tell me why
var TheDamage : 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.transform.SendMessage(“ApplyDamage”, TheDamage, SendMessageOptions.DontRequireReceiver);
}
}
}
Everything okay, it seems. Is there anything other than that in your script?
Also, try to make a change and undo if neccessary, save the file again and let Unity re-import/compile. the script. Sometimes it simply doesn’t do that when a change has been made.
He means you need to post the full script from top to bottom so we can see if there is anything wrong with like the {} or a ; at the end of a code line