Unity
Basic Spawner Script
Introduction
This script will spawn objects at the location you choose.
Features
-Set max amount of objects that can be spawned and how often they can spawn
The Code
License Terms
Attribution 3.0 Unported - You must attribute the work in the manner specified by the author or licensor. Commerical use allowed.
Frequently Asked Questions
Q: How do i create a prefab?
A: Drag your object from the Hierarchy into the project files.
Instructions
Place an empty game object then attach the script. In the inspector you should see options for the script.
1: *What object(prefab) you want to spawn.
2: *Where will this object be spawned?
3: Timer – Leave alone as its used to keep track of time.
4: *How often something is spawned. Lower number = faster the spawn. 0 = instant.
5:* How many objects are allowed to be spawned before the spawner stops.
6: How many have spawned – leave alone cause its used to keep track when the max is reached
*Required to be set
Author Notes
Todo…maybe:
Make it so you can set unlimited for max
Add the ability to add a lifetime to each object spawned
Version History
1.0 – Release
Credits & Thanks
Polraudio – No need to add to credits as it was a simple and fun script to make.
Comments (5)
Leave a Reply
You must be logged in to post a comment.
Marked
Sweet! Our first Unity article 😀 I didn't even know you could use JS in Unity… that's awesome.
Polraudio
Yup you can use JS C# and Boo. No clue what Boo is.
drago2308
OH yay scripting in unity is a thing! (I might have a go at it. I never really tried)
ShinkuAura
I may not know much about scripting in Unity. But do know how to get around it. Such as level design.
Michael Martin
instantatE? VB [b]WUB[/b]