VR NOIR SWARMER
a team vr shooter in unreal engine 5.8. i made the weapons, the ammo pouches and the sky.
the weapons and the sky are art, but four things in vr noir swarmer were hard to get right, and i built all of them in blueprints myself: reloading both guns one round at a time, pumping the shotgun by hand before every shot, streetlights that switch on one at a time, and a smoother way to walk and turn in a headset. the graphs below show how the streetlights and the walking are put together.
loading the weapons one round at a time
neither the leviathan nor the shotgun has a reload button. you take a shell or a round out of its pouch on your hip and put it in the gun yourself, one at a time.
the loading is a handshake between the round and the gun that doesn't need either to know the other's blueprint. the pouch follows your body and puts a shell or a round in your hand when you grab it. when you let go of it, it looks for actors in a small sphere around it and asks each one whether it implements a receiver interface, with one function that means "here's one, did you take it?". the shotgun has BPI_ShellReceiver with AcceptShell, and the leviathan has BPI_RoundReciever with AcceptRound. a gun answers yes while it has room, ShellCount below MaxShells for the shotgun and AmmoCount below MaxAmmo for the revolver, counts the new one in, and the round destroys itself when it was accepted. if nothing took it, it just drops on the floor as a normal prop.
the pouch itself is two small graphs. BP_AmmoPouch is a grab target, and when you grip it, it spawns a BP_AmmoCluster in your hand with physics switched off so it rides along, and letting go anywhere else drops it as a normal prop.

the slide keeps its place with UpdateAmmoPouchPosition. it reads the headset, keeps only the direction you are facing, and puts the slide at a fixed offset from your head, turned by that same angle. because only the facing direction counts, turning your body carries the slide round with you, and looking down or tilting your head doesn't move it.

the revolver has one extra step because of the cylinder. it has two states, open and closed (E_RevolverState), and a button, IA_ReleaseChamber, that swings the cylinder out and back with a timeline, so you can only put rounds in while it's open. each part has its own sound: opening, a round going in, closing and a dry click when it's empty.
pumping the shotgun
after every shot the shotgun has to be pumped by hand before it will fire again. the pump is a second grab point on the gun, separate from the grip. while you hold it, the gun measures how far your pump hand is from where the pump rests along its slide direction, and the pump mesh follows your hand along the slide, so it moves with you instead of snapping. when you've pulled it back past pumpPullDistance the gun counts it as pulled, and once it's back in place the gun is ready to fire again. there is a haptic buzz in the pump hand while you do it and a separate start and end sound. in between there are two flags: firing sets bNeedsPump, and the gun only fires when bCanFire is true and there's a shell in it, otherwise it just clicks. each shot is a handful of pellets from PelletCount, each one a line trace with its own damage, so a shot spreads.
the streetlights
the rule is that only one streetlight in the level may be lit at any moment, so something has to act as the referee. i used the game mode, BP_StreetlightGameMode, because it already exists in every level and any actor can reach it. it holds one boolean, bIsAnyLightActive, and a function called AttemptActivate that checks the boolean and claims it in the same call. blueprint runs one call at a time, so two lights can never both read free and both take the slot.

each BP_Streetlight runs on a single timer and nothing ticks. when the timer fires, a lit light switches itself off and hands the slot back through ReleaseActivation. a dark light asks for the slot, and only lights up if it got one. both paths end by calling ScheduleNextStep, which asks GetNextDelay for a random wait (longer while the light is on, shorter while it's off) and starts the next timer. there is only ever one timer pending per light, and the light's EndPlay clears it and gives the slot back, so a light that gets destroyed while lit can't lock the others out.

walking and turning
the template's movement was a teleport and a snap turn, which is rough in a headset, so both became continuous. SmoothTurn rotates the pawn by the stick push times a turn speed times the frame time, so the speed is the same at any frame rate. rotating the pawn turns it around its own origin, and your head is almost never there, so a plain rotation swings you sideways along an arc. the function stores where the head is before the turn, rotates, then slides the pawn by the difference, which leaves the head where it was and turns the world around you.

walking follows the same idea. the step comes from the direction the head faces with its up and down part thrown away, so looking at the floor doesn't push you into it. the pawn has no collision body, so TryWalk works out where the head would be after the step and asks the navigation system whether that point is on the navmesh. a step that lands off the mesh does nothing, and you simply stop at the edge of the map.
