New account registrations are disabed. This website is now an archive. Read more here.

Unity    Posted August 7, 2014 by Polraudio

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.
Posted Image

Instructions

Place an empty game object then attach the script. In the inspector you should see options for the script.
Posted Image
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

Polraudio

  • Posted about 11 years ago

  • Engine
    Unity
  • Category
    Misc System
  • License
    Attribution 3.0 Unported
  • Version
    1.0

Stats

2,507 views

5 comments

Tags

n-a