Final Project: Networked Countdown Spawner
Combine everything from this course into one networked feature.
Requirements
- Create a networked prefab (
NetworkObject+ aNetworkBehaviourscript) representing an enemy spawner. - On the server, run a coroutine that counts down from 5 seconds using
WaitForSeconds, syncing the remaining time to clients through aNetworkVariable<float>. - When the countdown reaches zero, the server should spawn an enemy prefab (
Instantiate+NetworkObject.Spawn()) and restart the countdown. - Expose a
[ServerRpc]that lets any client request an immediate spawn (e.g. for testing), guarded so it only works before the match starts. - Use a
[ClientRpc]to play a sound or log a message on every client the moment an enemy spawns.
Stretch goals
- Cap the number of enemies alive at once, checked server-side before spawning.
- Show the synced countdown in on-screen UI using
NetworkVariable.OnValueChanged. - Handle a client that joins mid-countdown, it should immediately see the current value, not start from zero.
Submit your repository link below when you are done, an instructor will review it before you can mark this lesson complete. Good luck! 🚀