The original Java Script:
static function MoveSomewhere(O:GameObject){
print("Moving");
while(1){
O.transform.Translate(Random.Range(-0.1,0.1),Random.Range(-0.1,0.1),Random.Range(-0.1,0.1));
yield WaitForSeconds(0.01);
}
}
The Boo translation of the above script, which should do exactly the same thing:
import UnityEngine
import System.Collections
class MoveBoo(MonoBehaviour):
static def MoveSomewhere(O as GameObject) as IEnumerator:
print("Moving")
while(1):
O.transform.Translate(Random.Range(-0.1,0.1),Random.Range(-0.1,0.1),Random.Range(-0.1,0.1))
yield WaitForSeconds(0.01)
The Java version works. But when I decide to use the Boo version I get this error in the console:
Assets/MoveBoo.boo(7,47): BCE0004: Ambiguous reference 'Range': UnityEngine.Random.Range(int, int), UnityEngine.Random.Range(single, single).
I don’t even know what this means. I’m completely relying on forum help for this. I’ve used Random.Range in Boo scripts before and don’t get this error. Thanks.