
Learn to build a hexagonal grid in Unity, create a procedural layout inspired by Hexachord, spawn and snap hex stacks, and implement the merging mechanic, with shader for main menu.
Explore the hexagonal grid in Unity using the grid component, hexagon layout, and cell size swizzle, plus a grid tester to map cells to world positions in orthographic view.
Create a procedural hexagon grid with a grid generator script, instantiating hexagon prefabs in a two-dimensional grid, controlled by grid size and world position mapping.
Enhance the scene by adding ground plane with grid material, adjust its offset to prevent hexagon overlap, and set up a stack spawner to generate hexagon stacks with orthographic camera.
Color the hexagon stacks by using a hexagon script with a color property tied to the renderer, selecting two random colors per stack from a predefined list.
Build and manage a hex stack in Unity by creating a hex stack script, initializing a hexagon list, and adding spawned hexagons for color-based merging.
Develop a stack controller that uses raycasts and mouse input to move hex stacks onto grid cells, with mesh colliders, layer masks, and occupancy checks to prevent overlaps.
Tackle the stack drag mechanic in a Unity hexa sort game, using raycasts and layer masks to detect ground or grid cells and move the stack toward a target position.
Move a stack by snapping it to a grid hex cell with occupancy check and raycast drag. Highlight target and place stack above the cell, or drop it if unoccupied.
This lecture covers snapping stacks to grid cells, dropping onto valid target cells, and reparenting stacks while disabling colliders to prevent moved items, paving the way for the merge mechanic.
Spawn new stacks by wiring a stack controller to grid cells, trigger on stack placement, and reset after three placements, while setting the game to 60 fps for smooth gameplay.
Create and attach a merge manager to merge stacks on a grid cell by detecting neighboring grid cells with colliders and comparing top hexagon colors to merge toward the center.
Explore merging hexagons in a hex grid by detecting similar neighbors based on top hexagon color, collecting and moving matching hexagons to a target cell, and updating stacks.
Merge hexagons by removing them from their stacks and adding them to a new stack, calculating the initial y position and target local position, then use line tween for transitions.
Refactor and modularize the hexagon stack mechanics by extracting neighbor grid cells logic. Compute similar neighbor grid cells, process complete stacks to destroy hexagons safely, and unparent before animations.
Animate hexagons in a Unity hexagon sort game using coroutines to manage moves, merges, and vanish effects with staggered delays and lean twin library moves for smooth gameplay.
Explore rotating hexagons using a line tween to rotate around, computing a rotation axis from direction via cross product with up, and applying a 180-degree, eased rotation with delay.
Update the grid by tracking updated cells, then check merges with similar neighbor cells using a merge manager and a coroutine in Unity to manage hex stacks.
Learn to streamline level making by generating a hexagon stack on a grid cell from a color list, spawning hexagons, and assigning them to the stack in editor and runtime.
Develop level making in part 2 by initializing the hex stack, instantiating and placing hexagons, disabling colliders, and turning grid cells into prefabs to streamline hex-based level design.
grabs and prepares the main menu shader assets by importing a tower fbx, editing in blender, aligning all vertices to z=0, and importing into unity for scene setup.
Create and tune a Unity URP lit shader with shader graph, assign it to tower materials, and drive a gradient from the vertex y using a field percent slider.
Implement a shader-driven color transition using field percent and step/lerp without if statements, add an edge highlight with edge width, and drive materials and a tower animation in Unity.
Use cube coordinates (q, r, s with q+r+s=0) to build a hex grid in unity, derive spawn positions with hex size, height, width, and 60/120 degree directions.
Hey Friend!
In this course, you will learn how to recreate various mechanics and effects from Hexa Sort, a famous and trending hypercasual mobile game.
We will start by creating a Hexagonal Grid using Unity's Grid Component. (Way simpler than creating our own system)
After you've clearly understood how this works, we will tackle Procedural Hexagonal Grid Creation, the basics actually.
We want to create a symmetrical hexagonal grid that we can then edit to Create Levels.
You will also learn how to create levels, the quick way.
After creating our grid, we will tackle Spawning Hexagon Stacks and controlling them.
We will learn how to Snap Those Stacks on the grid and Merge everything when it makes sense.
The trickiest part of the system is, you guessed it, the Merging Mechanic. We need to Iterate over Every Cell that has been updated during the previous merge.
It might sound weird, but you'll know how to do that after completing the course!
I'm also going to include some lectures on the Shader in the Main Menu, because that's something I find cool.
And if you want me to Explore More Hidden Gems of this game, please let me know!
Ready to jump in? Enroll now!
Disclaimer : This is not a beginner course, you need to have some basic Unity & C# knowledge before starting this course.
It's best if you know about loops, coroutines & actions.