Object Spawner is a tool that lets you spawn objects in a area. This tool can be used creating environments, scattering props or anything else you can imagine.
To get started using Object Spawner Tool we need to create a holder for our particles.
We refer to a particle as one prefab/object that is spawned at a point we paint.
Create a GameObject in the hierarchy.
Attach the Object Spawner Tool script as a new component.
All properties has tooltips if you hover over them in the inspector that tells you what they do.
Update Mode
This handles when the objects we paint should update and recalculate everything. It is very important you understand when you can use each of the Update Modes to avoid any freezing when painting later on
The painter tool never lags or freezes the game, only in the editor when modifying it.
1
Update Mode Auto
Updates whenever you change any of the properties in the inspector. Use this carefully.
2
Update Mode Manual
Updates only when painting. When changing properties in the inspector, you will have to press the Update button visible when this setting is enabled to update the painter.
Layers
The objects that are spawned are divided into different layers. Each layer has its own objects to spawn which can be set in the inspector window.
You can for example have one layer for rocks, another for cliffs, another for vegetation and you'll be able to spawn all layers at once.
More information about keybindings are available in the same inspector window as the Tool itself.
Spawning Prefabs using Object Spawner Tool
Follows is an example workflow of spawning prefabs in an area using the tool.
1
Add the Object Spawner Tool to a GameObject
2
Change to Auto Update Mode for Faster Feedback
3
Add a new layer
In inspector, add a new layer under Layers and give it a name.
4
Assign the Prefabs you want to Spawn
Under the newly created layer, add a new Object under Objects and assign your prefab here.
You can add multiple objects and it will choose randomly between them (by their weight).
Set the Size and Rotation.
5
Place the GameObject somewhere in your scene
Simply move the GameObject with the Object Spawner Tool attached anywhere in your scene.
If you have Auto update enabled, it should spawn the objects inside the area.