What is wrong with my script (74752)

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

–

Worst. Title. Ever. And you tagged it "tag"? Come on, act like you care.

–

1 Answer

1

Lines 5, 6, 13 and 15 are meant to have braces, not parentheses. Parenthesis as end of line 6 is meant to be an opening brace.

Thank you so like this } is that a bracet.exuse my bad question but im only 11 years old.

–

Yes, { and } are braces.

–

Thanks :-)

–