var TheDamage : int = 50;
var Distance : float;
function update ()
(
if (Input.GetButtonDown("fire1") )
var hit : RaycastHit;
if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.foward, hit) )
{
Distance = hit.distance:
hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReciever);
)
}
)
Please format your code correctly, and provide additional information such as what error you're seeing, what you've tried to do to fix it and so on. As a new user here you should also check out these links to learn how to get the most of Unity Answers... - http://answers.unity3d.com/page/newuser.html - http://video.unity3d.com/video/7720450/tutorials-using-unity-answers
– Dave-CarlileWorst. Title. Ever. And you tagged it "tag"? Come on, act like you care.
– Kiloblargh