ViroReact 2.56.0: Build AR games that play in the real world

Over the last few releases ViroReact grew to cover the whole XR spectrum, from mobile AR to VR on Meta Quest. 2.56.0 is about what you do once you get there. This release ships the missing pieces for building actual games in AR, lets a ball roll off your real table and bounce on your real floor, and opens up the front-facing camera for face effects and selfie AR. All of it in the TypeScript and React Native you already write.
A real game loop, at last
Per-frame logic never belonged in React state. If you wanted to move something on every frame, you were fighting the reconciler. ViroGameLoop ends that fight. Mount it as a headless node anywhere in your scene and you get per-frame callbacks straight from the native render loop, plus a fixed-step accumulator that runs your physics deterministically no matter what the frame rate is doing.
There are hooks for the cases you reach for most, useGameLoop, useLateUpdate and useFixedUpdate, and a set of utilities that write position, rotation and scale directly while skipping the reconciler entirely. Move a thousand objects every frame without triggering a single re-render.
Controls that feel native, because they are
ViroVirtualJoystick and ViroVirtualButton give you on-screen game controls rendered natively. The good part is underneath: touch input lands in a shared controller state with single-digit millisecond latency, no round trip across the JS bridge to slow it down. Pair a stick and its buttons with one controllerId, lay the buttons out like a gamepad, and read the live input straight from your game loop. It feels like a controller because nothing gets in the way.
Stream audio in real time
StreamingAudioManager takes raw PCM audio and plays it the moment it arrives. Pipe in a text-to-speech voice, a live synthesiser, or audio your game generates on the fly. Create a player, start streaming at your sample rate, push samples, hear them. This is built for low-latency runtime sound, not pre-baked clips, so your audio can react to the game as fast as the game does.
Your room is the level
Turn on worldMeshEnabled and the space around the player becomes a physics-ready surface. A ball rolls off the edge of your actual table and bounces on your real floor. ViroReact picks the best source your device offers automatically, from LiDAR all the way down to plane detection, and builds the collision mesh on a background thread so your render thread never stalls.
Most phones have no LiDAR, so we went further. On supported iPhones, an on-device neural depth model delivers occlusion, hit tests and world mesh with no LiDAR hardware at all. It throttles its own inference based on the device thermal state, so you never have to babysit it. Monocular depth is iOS only for now.
Turn the camera around
Set frontCameraEnabled and the AR session flips to the front camera for face effects and selfie AR. Everything you have already built keeps running: 3D content, lighting, physics, the game loop, streaming audio. Plane detection and world tracking behave differently up front, and the docs walk through exactly how.
For finer control, ViroCameraTexture binds a live camera feed to any material. Aim it at a flat surface for a mirror, drop it into picture-in-picture, or use it for a VR selfie. Unlike full-screen front-camera mode, this keeps your back-camera AR tracking alive at the same time.
The bigger picture
Look at these pieces together and a pattern appears. A deterministic loop, native input, real-time audio and real-world collision are exactly the primitives a game or simulation engine needs. With 2.56.0 you can take an external simulation engine running in native code, step it from the fixed-step loop, feed it controller input and world geometry, stream its audio, and render its output live through Viro. The engine does the simulation. ViroReact puts it in the room. That opens a lot of doors, and we cannot wait to see what you build behind them.
Get started
Update the package:
npm install @reactvision/react-viroYou can get the full details on this update by reading the full changelog, and all new components are available within our documentation.