Hi NetCode peeps,
A very very common pattern in NetCode is the spawner pattern.
You have an entity in your scene that simply spawns a prefab at runtime, often based on some system logic.
Could be characters, bullets, buildings whatever.
This works well, but when authoring these things there is often visual to assist with placement and it’s just very tedious. Right now I use a little hack where I render the mesh using OnDrawGizmos but this doesn’t work for everything. On the road to 1.0, I would love to a good implementation of a spawner authoring script, either from Unity or the community.
It should have features like:
- Preview: render the spawn prefab in the scene maybe with a special shader to highlight that its a spawner
- Spawn Method: once on load, via system logic
- Target World: client/server/both (useful for “visual only” objects on the client and prefabs with companions)
- Nesting Support: should be possible to have a spawner as a child of another prefab that triggers when that prefab spawns
What do you think? Let me know your thoughts and suggestions!
To me the beauty of Unity is the power of scriptable tooling, I hope we can make netcode so much better by leveraging that.