- Home /
Parsing error on MeleeSystem script
I've recently started trying to make a game using a dated tutorial have reached the part where I have to make a melee script. I followed everything to the letter and even sought out some corrected versions, but I keep receiving a parsing error and a error with the #pragma strict.
 #pragma strict
 
 var TheDamage : int = 50;
 var Distance : float;
 var MaxDistance : float = 1.5;
 
 function Update ()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         var hit : RaycastHit;
         if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit))
         {
             Distance = hit.distance;
             if (Distance < MaxDistance)
             {
                 hit.transform.SendMessage("ApplyDamage"), TheDamage, SendMessageOptions.DontRequireReceiver);
             }
         }
     }
 }
Error Codes received
Assets/MeleeSystem.cs(3,15): error CS8025: Parsing error
Assets/MeleeSystem.cs(2,0): warning CS1633: Unrecognized #pragma directive
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
Compile Errors for Script 1 Answer
Error CS8025 compiler error 1 Answer
cs8025 Parsing Error 0 Answers
CS8025 Parser error 2 Answers
Errors CS1525 and CS8025.... 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                