← Back to Blog

NeChessFel - A multiplayer chess game made in Unity3D

An experimental Unity3D project designed for mobile devices, where you can play an online chess match against a friend.

Each piece is derived from the Piece class, and all of them override the abstract method GetPossibleSteps.

public abstract List GetPossibleSteps();

This returns the fields the piece can move to on the current turn, depending on its position.
The controls are simple. Touch the screen with two fingers to rotate the camera around the board. When you touch the screen, the initial touch position is stored; the horizontal offset from it, scaled by a RotationSpeed parameter, rotates the camera around the center of the board until you lift your fingers.

Game icon


If you tap the screen once, then using a raycast from the screen position converted to a world space vector, the program checks if it is intersecting with the board. If an intersection was found, then the selected field is calculated and highlighted with a nearest neighbour interpolation. This way the user can select any piece, if it is their turn. Once a piece is selected, the possible steps are highlighted. If a highlighted field is selected afterwards, then the step is executed.
The backend was built by a colleague. The server is an ASP.NET Core application that manages matches and synchronizes moves, with a REST API for frontend-backend communication.