Hey guys,
I’m pretty new on Unity and I tried following some tutorials to get into scripting. I already fixed a lot of errors on my first script but there is still one remaining. I don’t know what to do, could you please help me?
The error is in line 13,17. I also looked into similar questions on this forum but none could help me.
I would really appreciate any suggestions!
#pragma strict
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);
}
}
}