So I'm working on an on rails space shooter and I'm trying to figure out how to add in an asteroid field.
I'm not too sure where to start. I mean I know that adding loads of asteroids in would be a bad idea. So I was hoping to come up with one and then instantiate(?) it through script into different places and sizes and even add rotation and movement if possible.
Like I said I'm a bit unsure of how to start this so any help would be really handy.
Thanks guys :)
Well, given a simple sphere prefab, you could try something like this-
This should spit out a bunch of asteroids for you!
answered Feb 19, 2012 at 01:29 AM
thx craigb ! got it !
now that i wanted to use it in a new scene i realized that i can't set the ast.-field at a wanted position. seems it always spreads the asteroids from 0,0,0. i attached this script to empty game object and placed it at 0,0,700. so i thought it would spit out the ast. from this point. but it doesn't ! i tried to work with a public transform and instantiate the prefab there but whatever i try i get errors.
would someone help me on how to set the ast.-field to the coords of the empty game object please ?