
Learn to build 3d tetris-style game in Unity, animating blocks, handling camera and mouse input (with touch), enabling rotation, placement, ghost piece, and preview window, with score, levels, and UI.
Explore building a fully functional 3D Tetris game in Unity, with a configurable play field, 3D grid, rotating blocks, player movement, gravity force, ghost previews, and scoring to advance levels.
Set up the Unity layout to view the scene and game at the same time, use fixed aspect ratios, and keep the console, inspector, hierarchy, and project windows visible.
Set up the playfield with a bottom plane and walls aligned to a 10 by 10 grid. Duplicate and rename planes, using snap settings to orient north, south, east, west.
Create textures and materials folders, import textures, and assign bottom grid, north-south, and west-east materials to the playfield in Unity using an unlit diffuse shader with tiling and shadow settings.
Create a resizable playfield grid by wiring public plane references and a grid size (x, y, z), resizing and repositioning the bottom plane in OnDrawGizmos, then test in Unity.
Automatically recalculate bottom plane tiling when resizing x and z by updating the mesh renderer material texture scale with grid size x and z.
Scale the north, south, east, and west playfield planes on the y-axis using grid size y, adjust their positions by half the grid, and reuse the shared material tiling.
Use gizmos to automatically resize and reposition the east and west planes in the playfield with grid size X and Z, share the material, and test in Unity.
Learn to implement camera input in unity to navigate around the tetris 3d play field using mouse or touch, orbiting around a rotation target.
Refine the orbit camera in Unity by implementing x-axis rotation around a rotation target, clamp angles with a custom clamp_angle function, and test stable up-down and left-right movement.
Create and center an empty game object as the rotation pivot, then build and color all blocks (t, i, z/s, o, l, c corner) with snapped pivots and grid-aligned positions.
Create and configure a tetris block script in unity, organize blocks as prefabs, and implement timed downward movement and valid-move checks to spawn new pieces and keep gameplay flowing.
Implement a singleton play field with an awake method, add a rounding function for vector3 positions, and apply it to all cubes to validate moves in the tetris 3d grid.
Implement a public check inside grid helper in Unity Tetris 3D to validate block positions within the play field, casting to int and updating the grid on valid moves.
Initialize the grid with x, y, z dimensions and update the play field by looping through all coordinates and assigning child block transforms to grid cells.
Update the game grid to reflect the current Tetris block position by calling the play field's update grid with the active block, and spawn a new tile when movement ends.
Implement a public function to query a grid position, verify occupancy, and validate moves and rotations for tetris 3d blocks inside the grid, avoiding intersections.
Drag blocks into the play field and use a block list to instantiate and spawn pieces when one can no longer move, with grid x y z visible in inspector.
Spawn a random block from the list at the calculated spawn point on the play field. Update the grid to prevent null references when blocks land.
Fix spawn block position by rounding the full position calculation to an integer and wrapping it in parentheses. Ensure blocks spawn aligned in the play field and test drop behavior.
Develop movement input for tetris blocks with a setInput(direction) function that moves the block by a vector3, checks validity, reverts if needed, and updates grid using arrow keys or wasd.
Implement rotation input for a 3D Tetris game by rotating pieces in world space with a rotation vector, validating moves, and rotating back if invalid, using mouse and keyboard inputs.
Create an input holder and a world-space canvas tied to the main camera, then add resizable arrow buttons to move Tetris 3D blocks along the x and z axes.
Create and arrange three rotation canvases for x, y, and z rotation, duplicating and renaming controls, positioning positive and negative rotation arrows, and preparing input handling.
Reposition the input folder pivot and canvases to the origin (0,0,0) in Unity, preserving rotation, save the scene, and prepare to write the code for the mini cleanup UI.
Creates an input holder script, implements a singleton instance, references the move and rotation canvases, tracks the active Tetris block, and adds a reposition function updated in the update loop.
Set the active Tetris block and InputHolder to follow the current block by exposing a public setActiveBlock method, wiring it across new blocks, and testing in Unity.
Enable movement of blocks with UI buttons in Unity Tetris 3D by implementing a public move block function, mapping on click directions left, right, forward, back with vector3 inputs.
Create a public rotate block function, wire six buttons to pass rotation vectors for 90-degree turns on the X, Y, and Z axes of the active Tetris block.
Enable 2-sided ui buttons by fixing accessibility from any rotation, deactivate ignore reversed graphics in the raycast settings, then test canvases from multiple angles and manage full layers.
Switch inputs in Unity by toggling a boolean move on to control move versus rotation, while deactivating other canvases and wiring a bottom-left button.
Add public void set high speed and public void set speed to control the tetris block fall rate, wiring a UI button to call these functions for faster blocks.
Learn to check each y height for a full layer in a Unity 3D tetris grid, delete that layer, and move blocks down by one row via dedicated functions.
Create a delete layer function that removes blocks in a given y layer. Loop over x and z, destroy objects, reset the cell, delete layer at y, and save script.
Implement the full-layer detection in a Unity 3D Tetris course by iterating y layers, deleting the completed layer, and moving all layers down while updating the grid and transforms.
Fixes to the delete layer logic in a 4x4 play field; tests with an O block and a top to bottom loop ensure layers drop correctly after deletion.
Perform a cleanup by resetting the grid, restoring the play field size to 5x8x5, re-adding all blocks, and automating the random first block spawn at start.
Create ghost blocks in Unity by duplicating blocks, assign a transparent ghost material, tweak color and transparency, then apply changes to prefabs and instantiate to preview landings.
Drag and link a ghost list to the play field script, and instantiate a corresponding ghost for each C block when spawning, ensuring the ghost sequence mirrors block list order.
implement a ghost block in a unity tetris 3d game by syncing its position and rotation with the active block and testing landings via a coroutine reposition routine.
Develop the move down function for the tetris 3d ghost, reusing valid-move checks from the tetris block and validating moves on the grid before updating the transform with vector3 down.
Finalize the goals script, start the coroutine, and implement a setParent function to pass the game object to the ghost and Tetris blocks, ensuring correct scripts and improved land preview.
Learn to implement a score system based on cleared layers and a next-block preview using a raw image with a secondary camera, plus UI layout for score, level, and layers.
Set up the next-piece preview by creating a render texture and raw image, attaching them to a UI camera, and applying an unlit material to a quad.
Create a preview spawner to display block previews, destroy active preview before spawning next, and add a rotate script to animate previews around the y-axis with a speed.
Finalize the Tetris 3D preview system by applying the rotate me script to all prefabs, adjusting speed, and ensuring the play field uses a calculated preview index for upcoming blocks.
Learn to manage score, level, and layers in a Unity tetris 3D game by creating a game manager, wiring the UI, and recalculating level and speed on layer clears.
Expose a public function to read speed and adjust it by level, from three seconds at level 1 to one second at level 10, and update score on layers cleared.
Implement the logic to award points when a layer is cleared, count cleared layers with a local counter in the delete layer function, and update gameManager.instance.layersCleared and the user interface.
Create UI text elements on the canvas to display score, level, and layers cleared for the Tetris 3D game, then align, color, anchor, and connect them to update.
Create a ui handler script to connect and update the score, level, and layers texts, exposing public text fields and an update method to reflect game manager values.
Set dynamic fall time for each tetris block from the game manager's full speed, recalculated with level updates. Update UI for score and layers, and adjust prefabs for rotation.
Learn how to detect game over in a Unity 3D Tetris game, manage game over state in the game manager, and prevent spawning new blocks when no valid moves remain.
Create a game over window in Unity using a full-screen dimmed canvas, a centered red game over text, show score and level, with play again or back to menu.
In this Course you'll learn how to create a Tetris 3D in Unity Game Engine.
We create the game so, that the player has to fill full 3D Layers instead of rows.
This course is a Beginner/Intermediate Course, so if you have trouble in any case, write me a message or Q&A, and i'll help as best as i can.
If you are beginner, you might have some trouble to follow, but the videos will guide you through the complete course. Don't forget you only become better if you repeat things and keep on learning!
So we create several Systems which will give us enough freedom to:
C# (Monodevelop)
create any Tetris like game
you learn about arrays functions, lists, variables and much more
access to other scripts the easiest way
resize the playfield automatically
Unity (2018.2.11f1)
create a Playfield of your liking
create Button Inputs to give the Player a way to control the tetris blocks
Create a simple Game Ove GUI
Menu and Game Scene and connect them together
Course Material
I provide:
5 white grafics as *.png for arrows and frames
You have to write the code on your own, i do not provide the final scripts!
All other graphics for Menu's, Icons, Images or Buttons need to be created on your own.
All Materials i provide are for education only and should not be in your final release!
Conclusion
In the end of this course you will have a fully functional Tetris 3D Game.
Challenge
After you have created nice Menus, Buttons, and maybe additional content, upload the Game to any Gaming Website, Google Playstore, Apple Store or even Windows Store or Steam.
So what are you waiting for?
Let's make your dream game a reality!!
Level: Beginner/Intermediate
Video Course Length: ~6 hours
Unity Version required: 5.6+