Spline Spawner Documentation

Spline Spawner
Version: 1.1.0
Review

3.5.Runtime #

None of the core functionality in this asset is editor-only, so spawning in play mode (runtime) is absolutely possible.

Respawning will take place when altering any of the splines in the assigned Spline Container.

If you are making changes to the Spline Spawner component through script, such as adding/removing objects, changing distribution settings or modifiers. Be sure to call the Respawn() function afterwards to apply the changes.

You can browse all the available functions and fields in your IDE. Press CTRL+Space after the ‘.’ (period) to do so:

Performance Considerations

Spline alterations

Whenever a Spline changes, it’s required to cache it by reading it out over it’s entire length and convert the data into a format usable by the Job System (eg. native arrays). Once this process has completed, the spline data will be used extremely efficiently for spawning.

But, the process itself is relatively costly. This means that respawning that happens based on spline changes is slower than just respawning by calling the Respawn() function.

Object pooling

The instantiation of objects is based on Object Pooling, which greatly improves the spawning performance. Though, when the pool is empty, and a Spline Spawner is prompted to spawn several thousand of objects the pool has to be populated with entirely new GameObjects, which negates the performance benefits for the first spawning operation. After which, the spawning of objects can be up to 20x faster.

On any Spline Spawner component you can call the WarmUpObjectPools(int capacity = 1000) function in order to emulate that first, slower, spawning operation. Or the static SplineSpawner.WarmUpAllObjectPools() function to do this for all active Spline Spawner components.

Destroying and recreating a Spline will cause the object pool to be destroyed and recreated as well. Avoid this if possible by overwriting splines instead.

Yes No Suggest edit
Last updated on August 14, 2025
1 of 1 users found this section helpful
If you're familiar with this asset, please consider leaving a review!
Your support is what makes complementary updates possible!
Suggest Edit