so i just started working with unity, and was watch a tutorial. i copied this script exactly from the video, but i get errors he doesnt. the script is
#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.transform.sendmessage("applyDammage", TheDammage, SendMessageOptions.DontRequireReceiver);
}
}
}
the errors i get are “unknown identifier ‘distance’” “unknown identifier ‘Hit’” "unknown indentifier ‘hit’
i have no idea how to solve this, so thank you for your help!