var fissure : GameObject;
var hit : RaycastHit;
var angle : float = 360;
function Start() {
while (true) {
Invoke("spawnFissures", 1);
var n = globalCountNew.overallScore / 100;
var timetonext = 20 - n;
yield WaitForSeconds(Random.Range(0, timetonext));
}
}
function spawnFissures() {
var ray : Vector3 = Random.onUnitSphere * 100;
var hit : RaycastHit;
if (Physics.Raycast (ray, Vector3.zero, hit, 1000) && hit.collider.gameObject.CompareTag("Ground")){
var position = hit.point;
var fissurePrefs = Instantiate(fissure, position, Quaternion.identity);
fissurePrefs.transform.eulerAngles.y = Random.Range(0, 360);
}
}
I'm failing to get any results with my attempted.
any ideas - Cheers C