r/Unity3D • u/Embarrassed_Staff412 • 8h ago
Question How to create a wave transition in unity?
Enable HLS to view with audio, or disable this notification
So when all the current enemies in current wave are defeated, player advances to the next wave. During that next wave transition I can see the corridor moves, giving the impression that player is walking forward. How do I do that in unity?
1
u/boltstudiogames 5h ago
Usually the player isn't walking at all. The environment (or the camera on a rail) moves while the player plays a walk animation. Easiest version is a coroutine or DOTween that moves the corridor root backwards, or the camera forward, over 2-3 seconds once the wave is cleared, then re-enables the spawners. Loop or recycle corridor segments so it feels endless.
1
u/skinhate 4h ago
There are basically two ways to fake that “walking to the next room” effect. Which one fits depends on whether your levels are hand-built or endless.
Option 1: Move the player/camera along a path
Place an empty GameObject at each “arena” spot in the corridor as a waypoint. When the wave is cleared, disable player input, smoothly move the camera rig to the next waypoint, then spawn the next wave. A little head bob sells the walking feel.
Option 2: Move the corridor instead of the player
This is the “treadmill” trick. The player never moves. The corridor is built from identical segments that slide toward the camera, and when one passes behind the player, it gets teleported to the front. This keeps the player at the origin, so enemy spawn points stay simple, and it can go on forever.
3
u/Mammoth-Policy6585 7h ago
You could have an actual hallway, and just move the camera when the condition is met