|
Hello, I am trying to use this script to spawn the enemies in my game (over a set interval of time using a random number, so that once every 15 seconds anywhere between 3 and 8 enemies will be instantiated)but it wont work, what is wrong? Thanks
(comments are locked)
|
|
This script is written in C#, my guess is that you might have saved it as a javascript. Also, there are some major errors in the script; here's a couple things to keep in mind when using C# in the Unity engine:
Here is the working script: Thank you. How would I make the range for the transform.position also random in the same style as the number of objects?
Nov 19 '10 at 07:03 AM
Tyler 2
wait, this may sound weird, but what exactly do I attach your script to?
Nov 19 '10 at 07:15 AM
Tyler 2
Updated my answer to show how to randomize the position.
Nov 19 '10 at 08:09 AM
PeterDC
You could attach the script to anything in the scene you want, however, I recommend attaching it to a camera or empty.
Nov 19 '10 at 08:11 AM
PeterDC
(comments are locked)
|

@Tyler: If an answer helps you, then please click the check mark next to it so it will not show up on the list of unanswered questions. Thanks!