So I am trying to get the size of my Collider, but it keeps giving me errors.
#pragma strict
static var CldHeadD : int[];
static var CldLeftD : int[];
static var CldRightD : int[];
static var CldFeetD : int[];
static var CldcornersD : int[];
static var Skin : float = 0.9;
static var Size : Vector2;
static var tp : Vector3;
function Start () {
CldHeadD = new int[4];
CldLeftD = new int[4];
CldRightD = new int[4];
CldFeetD = new int[4];
CldcornersD = new int[4];
}
function FixedUpdate () {
tp = transform.position;
Size = this.GetComponent<BoxCollider2D>().size;
for (var XU : int = 0; XU <= CldHeadD.length; XU++){ /*aray length*/
var HitUp = Physics2D.Raycast(Vector2(/*pos.x*/tp.x + (XU - (Size.x * 0.5)) * Skin/*pos.x*/, /*pos.y*/ tp.y + (Size.y * 0.5) * Skin/*pos.y*/), Vector2.up);
CldHeadD[XU] = HitUp.distance;/*Set distance*/
print(CldHeadD);
}
}
and I get these errors.
Assets/Jorge/Scripts/Player/NEW/Colliding2.js(22,49): BCE0043: Unexpected token: ).
Assets/Jorge/Scripts/Player/NEW/Colliding2.js(22,50): BCE0044: expecting ), found ‘.’.
Assets/Jorge/Scripts/Player/NEW/Colliding2.js(22,51): UCE0001: ‘;’ expected. Insert a semicolon at the end.