How to perform Explicit typecasting in UnityScript?

Typecasting as in from Object to GameObject, int to float etc.

You can use “as” for reference types.

var foo : Object;
var bar = foo as GameObject;

There isn’t a direct method for value types, but you can use parseFloat or parseInt in the case of floats and ints.

float myHealth = 10f;
int healthA = myHealth as int;
int healthB = (int)myHealth;