Here is my code in my GameMaster script to create an asteroid in my game every second:
var NextAsteroidTimer = 0.0;
var aster : transform;
function Update () {
NextAsteroidTimer += Time.deltaTime;
if (NextAsteroidTimer > 1)
{
NextAsteroidTimer = 0.0;
var asteroid = Instantiate(aster, Vector3(0,0,0), Quaternion.identity);
}
}
But I am not understanding the 'var aster : transform' along with 'aster' being part of the Instantiate statement. Somehow 'aster' has to refer to my prefab which is in my project view as 'prefab_asteroid'. What are the additional step/steps I need to do? I am not getting clarity on what I am reading in the Unity documentation and searching this board and the community board.
Thanks for any help.