Hello,
im new:) I have coded this code:
#pragma strict
var TheDammage : int = 30;
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);
}
}
}
But there are 3 Errors?! ![]()
Nr.1 : transform is not a member of System.Type Nr.2 : distance is not a member of System.Type Nr.3: An instance of type UnityEngine.Transform is required to access non static meber position
Can someone help me?