There are console errors :
Temp/Assembly-UnityScript.dll
Assets/IgracGlavno.js(13,13): BCE0043:
Unexpected token: allTargets.Assets/IgracGlavno.js(13,46): BCE0043:
Unexpected token: ).Assets/IgracGlavno.js(15,32): BCE0044:
expecting }, found ‘=’.Assets/IgracGlavno.js(15,33): UCE0001:
‘;’ expected. Insert a semicolon at
the end.Assets/IgracGlavno.js(20,1): BCE0044:
expecting EOF, found ‘}’.
This is script:
var range:float;
var damage:float;
function Attack(){
//enable either one of this
layerMask=3<<8; //target both land and air
//~ layerMask=1<<8; //target land unit only
//~ layerMask=1<<9; //target air unit only
var allTargets:Collider[]=Physics.OverlapSphere(transform.position, range, layerMask);
for(allTargets:Collider in allTargets)
{
targetCom:Creep=target.gameObject.GetComponent.<Creep>();
targetCom.ApplyDamage(damage);
}
}
What is wrong?