Q:

get transform from raycast array

//you sould be able to get away with something like this:
RaycastHit2D hit = Physics2D.CircleCastAll(currentSoldier.transform.position, currentSoldier.weapon.range, new Vector3(0, 0, 0), 0f);
transform transform = hit.transform;
1
  RaycastHit[] castArray = new RaycastHit[14];   
  RaycastHit[] f = Physics.RaycastAll (transform.position,transform.forward,50);    
  for (int i = 0; i < f.Length; i++)  
  {     
  		if (f[i].transform != transform && f[i].collider.tag != "Terrain")      
        {          
        	castArray [0] = f[i];
            fDetected = true;
        }
 }
0

New to Communities?

Join the community