VRChat Squat world: rows of training mats with instruction boards

Engineering

2022

VRChat Squat

A VRChat world where a character cheers you on while you do push-ups and squats.

VRChat

Unity / UdonSharp

State machine

Class design

Maker Faire

Platform

VRChat, built with Unity and UdonSharp

Input

Headset position only — no extra controllers or sensors

My role

Nearly every stage: planning, state-machine and class design, and Unity implementation

Released

Announced on Twitter in November 2022; shown at Ogaki Mini Maker Faire 2022

Background and technical challenge

Since the pandemic, the need to make up for lost exercise at home — and for fitness inside VR — has grown. We focused on a familiar problem: working out alone and in silence is hard to keep up. The aim was a workout world in VRChat where you can check your form alongside avatars and keep going, cheered on, and actually enjoy it.

The technical core was an interaction constraint: count squats and push-ups using only the headset position VRChat already provides (headData.position.y), with no extra controllers or sensors. The height of the head had to be tracked in real time so that every dip could be counted accurately.

Constraint. No extra devices: every repetition is counted from head height alone.

Role and scope

Developed within the ailab* team, but I handled almost every stage myself — from planning, through state-machine and class design, to implementation in Unity.

Planning

A workout world where you copy the avatar next to you and are cheered on to keep going.

State-machine design

Four game states, and the events that move the game between them.

Class design

Small classes that each watch the shared game status and act on their own.

Unity implementation

The world itself, with separate lanes for push-ups and squats.

Technology and architecture

Platform

VRChat: the world is built on Unity and UdonSharp.

Input

No extra devices. Movement is detected from the player’s head-tracking data (headData.position.y) alone.

State management

GameStatus defines four states — GameStart → TrainingStart → TrainingEnd → GameEnd — and a state machine moves between them on events: stepping on or off the mat, pressing Start, reaching the target count, pressing EXIT.

The game is split into small classes. Each one watches the shared game status and acts on its own:

GameManagement

Game flow and status.

MatON

Mat on / off detection.

PlayerUI

Screen and buttons.

Counter

Repetition count.

SoundSystem

Music and cheering voice.

CalorieCount

Calorie display.

Mirror

Mirror settings.

The field has several lanes — for push-ups, for squats and so on — so every player steps onto their own mat and plays independently.

Class diagram of the VRChat Squat worldGameStatus state machine diagram

What took some care

To count one repetition accurately from head position alone, I tuned the squat thresholds and timing.

So that several people playing on separate mats never cross wires, every mat has its own independent state machine.

Reaching the target count triggers a cheering voice — a game-like sense of achievement reinforced with sound and UI.

Squat lane: a mat, an instruction board and a cheering characterPush-up mode in VRChat: counter board and mat
Doing a push-up in a VR headset

Results and impact

Public release

Announced on Twitter in November 2022 and opened to everyone as a world anyone can play in VRChat.

Ogaki Mini Maker Faire 2022

Exhibited at Ogaki Mini Maker Faire 2022.

Concept reception

The idea that you can copy the avatar next to you to work out with good form got a positive response.