Unity VR Rhythm Game - Generate Objects Move Toward Player
In this Unity VR XR Toolkit tutorial, I'll show how to make a VR rhythm beat game like Beat Saber or Synth Riders. I'll generate game objects that move toward the player. ► Art Assets - Polyverse Skies https://assetstore.unity.com/packages/vfx/shaders/polyverse-skies-low-poly-skybox-shaders-104017
This installment of a VR rhythm game builds the note objects, spheres styled after Synth Riders, that spawn down-screen and fly toward the player on beat. You will set up one prefab for each hand, give it velocity-based motion and a self-destruct, then create spawners and a game manager that generate them on a loop. The math is deliberate: spawn 30 units away and move 10 units per second so each sphere takes three seconds to reach your hands.
Build the note object
Create an empty game object named blue at the origin and tag it blue (a matching pink tag handles the right hand). Inside it, add a 3D sphere, apply the left-hand blue material, and scale it to 0.2. Remove the sphere's own collider and instead add a sphere collider to the parent, scaled to match and marked as a trigger so you can later add or remove score on hit or miss. Add a Rigidbody and uncheck Use Gravity so the note never falls.
Move it with velocity and clean it up
Add a Playmaker FSM with a Move state that uses Set Velocity on the Z axis. Set velocity to negative 10 in world space so the sphere travels toward the player (a common mistake is leaving it positive, which sends it away). Follow with Get Position every frame, storing the Z value in a z position variable. Add a Float Compare against negative 2 with zero tolerance; once the sphere passes that point it has gone behind the XR origin, so send a destroy event to a Destroy state that calls Destroy Self. Duplicate the finished prefab, swap to the pink material, and save both to a prefabs folder.
Place the spawn points
Create empty game objects for the blue and pink spawners 30 units down-screen, offsetting each slightly on X (around negative 0.3 and positive 0.3) so the two hands stay separated and visible in the editor.
Drive spawning from a game manager
Make a game manager with an AI Spawner child holding an FSM named Blue Spawn. Use Create Object to spawn the blue prefab at the blue spawn point, parenting new notes under a generated objects container to keep the hierarchy tidy. Add a Finished transition to a short Wait state of one second, then loop back, creating a steady stream. Duplicate the FSM component, paste it as new, rename it Pink Spawn, and point it at the pink prefab and spawn point. In the headset you now see notes for both hands streaming toward you, ready for the beat timing covered in the rhythm tutorial.





