Version 2.0 is a complete rebuild. This update replaces all of the previous content (v1.0) with a new project. Back up your project before updating; v1.0 scripts and scenes are not kept.
Online play needs Photon PUN 2 – FREE (Exit Games), which is not included. Import it separately from the Asset Store. You also need a free Photon account and App ID. Photon's own terms apply, and Photon charges for usage above its free tier.
Chess XR Game Template is a finished VR chess game you can open, play, reskin and ship. Players sit at a table in a candle-lit Victorian library and pick up detailed 3D pieces with a thumb-and-index pinch. They can play the built-in chess engine or another player online.
The project is written to be read and extended. It has a pure C# chess engine with no Unity dependency, a network layer that works with any transport and checks every remote move, and a lightweight XR rig with no third-party interaction framework.
Gameplay
Pinch-to-grab pieces with the controller trigger or hand tracking. Legal moves are highlighted, a ghost previews the landing square, illegal drops glide back, and you get haptics.
Full chess rules: castling, en passant, promotion (with a picker or auto-queen), check, checkmate, stalemate, the 50-move rule, threefold repetition and insufficient material.
Built-in C# chess AI (PVS / alpha-beta search with a transposition table, quiescence search, null-move pruning and LMR) running on a background thread, with Easy, Medium and Hard levels.
Undo, a hint arrow, a move list in SAN, chess clocks, resign, and an end screen.
15 piece sets and 9 boards, including high-detail sculpted knights. An unlock system uses stars, streaks and challenges, and a showcase cabinet displays them.
Seated comfort mode, recenter, adjustable table height, and a fade when you leave the seat area.
World-space menus you use with a laser pointer or a finger poke.
Multiplayer (with Photon PUN 2)
Quick match, private rooms with 5-digit codes (optional 10+5 clock), and rematch.
An "Online now" lobby to see who's online, send and accept or decline challenges, and set do-not-disturb.
The opponent appears as a head-and-hands avatar.
Each client checks every remote move (legality, turn and position hash) to prevent desyncs and cheating.
Hooks for ranked Elo and leaderboards, which need your own backend (not included).
Hands
Player hands come in several styles (realistic light and dark, white, black, grid and more) and are calibrated for pinching.
They're built from the Unity XR Hands "HandVisualizer" sample mesh, which the template imports from the XR Hands package automatically. The sample isn't redistributed.
For developers
Assembly definitions and namespaced code (VRChess.*). The online code only compiles when PUN 2 is present, which is detected automatically.
A procedural scene builder regenerates the room, board, pieces and rig from code.
To use another networking SDK (Netcode, Fusion, Mirror and others), implement one interface (IChessOnlineTransport).
Ready-to-play demo scene plus a step-by-step guide in Documentation/README.md.
Limitations
Ranked Elo and leaderboards need your own backend. Without one, all online games are casual and the six online-rank unlocks stay locked.
Tested with Touch-style controllers. Other controllers need their OpenXR interaction profile added.
The demo room's lighting is baked, so re-bake if you change the room.
Photon setup (online play)
1. Import PUN 2 – FREE (Exit Games) from the Asset Store.
2. The template adds the scripting define VRCHESS_PUN automatically and logs "Photon PUN 2 found, online play enabled". If it doesn't, use Tools > VR Chess Template > Refresh Photon Detection.
3. Create a free account at dashboard.photonengine.com, then Create a New App with Photon SDK PUN and copy the App ID.
4. In Unity, open Window > Photon Unity Networking > Highlight Server Settings and paste the ID into App Id PUN. A Fixed Region (for example eu) is recommended so all players meet in the same region.
5. In the menu, open the Online tab and use Quick Match, Private Room, Join Code or Online now.
Photon's free plan allows 20 concurrent users. Larger games need a paid Photon plan.