- Home /
 
               Question by 
               DGArtistsInc · Mar 03, 2012 at 05:17 PM · 
                colliderfor-loop  
              
 
              the "in" Syntax
the title may be a bit confusing but I've been shooting myself in the foot trying to figure this out. im making a for loop
 for(Collider hit in colliders)
and i keep getting this error
Unexpected symbol
in', expecting)',,',;',[', or='
i know what it means but how else would i do this!?!?!?!?!?
i've seen others use "in" in for loops whats wrong with mine?
any help is appreciated
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by aldonaletto · Mar 03, 2012 at 05:42 PM
In C#, it should be:
   foreach (Collider hit in colliders)
In JS, it's:
   for (var hit: Collider in colliders)
O$$anonymous$$G that makes so much more sense sorry for the noob question im switching over to C# but THAN$$anonymous$$S ALOT
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                