New URP 2D sample project: Gem Hunter Match - Download now

Hi everyone

We’re very excited to announce our new 2D URP demo, Gem Hunter Match, a new official Unity sample that shows you how a 2D puzzle/match-3 game can stand out from the competition with eye-catching real time lighting and visual effects created in the URP in Unity 2022 LTS.

Download the sample, together with its mini-manual, and get ready to dive for riches in crystal blue waters populated with brightly colored jewels and sea creatures. You’ll learn how to prepare and light 2D sprites to add depth, apply a Sprite Custom Lit shader for shimmer, and create glare and ripple effects.

>> Download Gem Hunter Match <<

Announcement Unity blog post

Expand on the sample, reuse its elements and scripts in your own projects, and test it on your mobile devices. This sample and its supporting content is designed to provide useful tips for everyone, from beginners to experienced 2D developers.

You can also explore the techniques shown in Happy Harvest, a top-down farming game using URP 2D, plus many more, in the e-book 2D game art, animation, and lighting for artists. You’ll find all of Unity’s advanced e-books and articles in the Unity best practices hub.

Note about Unity 6, in order to test the sample in an early version of Unity 6, the TileShader Shader Graph, needs to have the NormalMap property changed from Global to Per Material in order to display properly.

Along with Gem Hunter Match, you can also try Happy Harvest and learn from a series of in-depth articles to show you how to create the 2D visuals so you can add them to your own projects:



5 Likes

This looks ace! Looking forward to dissecting it!

3 Likes

qué bonito :0

1 Like

Any suggestions are welcomed Andy

Me alegro que te guste :slight_smile:

Gem Hunter is beautiful, I was looking for a solution for a match 3 game for a long time.
I learned a lot with this game.
I’m still left with 1 problem: I can’t get the shop part to work.

1 Like

Does it not work when you play the game or when you try to modify it? can you provide more detail?




Hello, we found a bug in the gem hunter gameplay. We did not modify any code. Sometimes there is a bug where empty tiles stop filling with gems. Attached are 2 videos demonstrating the issue. How can we fix this? We cannot find the bug in the code.

There are no errors in the console. Please help us fix this issue since it is coming from the default Gem Hunter Match Template

We want to help, but we need instructions to reproduce the bug. Is there a certain combination of moves, or position of elements where this happens? We try but we can’t reproduce it. Maybe it’s a timing issue, but we need to be able to reproduce it to fix it

This bug becomes more apparent when the “Amount of Gems in a Level” is set to 3. It specifically occurs during rapid swaps involving bombs or rockets.

To reproduce it, ensure there are falling gems directly above the bomb or rocket. While these gems are descending, execute a swift lateral swipe (either left or right). As a result, the falling gems will not continue to drop as expected but will instead remain suspended in the air, directly above where the bomb or rocket was located. This leaves a line of empty tiles beneath the original swap location.

Ok thanks, we will look into this

1 Like

We found another bug that may be related to the issue. It happens when doing really fast swaps with rockets or bombs.

NullReferenceException: Object reference not set to an instance of an object
Match3.Board.TickSwap () (at Assets/GemHunterMatch/Scripts/Board.cs:1087)
Match3.Board.Update () (at Assets/GemHunterMatch/Scripts/Board.cs:490)

The Game even got stuck this time and the NullReferenceException is slightly different.


NullReferenceException: Object reference not set to an instance of an object
Match3.Board.TickSwap () (at Assets/GemHunterMatch/Scripts/Board.cs:1089)
Match3.Board.Update () (at Assets/GemHunterMatch/Scripts/Board.cs:490)

Here is a video to showcase how to reproduce this bug. Sometimes the swap does not even need to be fast as you can see! It also does not matter in which direction you swap. This time there was no error in the console.

Observe carefully as an automatic match is triggered, during which the rocket is simultaneously pulled into the match, potentially causing the bug.

Looks like the same issue… we will try to have a look

This sample got way too many bugs. We found a complete new bug. When you spam swaps the game is running in slow motion, possibly due to the fact that the board update logic is dependant on input. You guys need to do more play testing. This bug instantly reproducible and destroys gameplay experience.

Then the board logic froze completely again…

When can we expect a new update for the sample?

hi. We are looking at it but can’t promise a date. Just please bear in mind that the main goal of this sample was to demonstrate Custom Sprite Lit Shaders and other 2D URP graphic features. We put the graphic examples in the context of a game, but this sample is not meant to be a final game to release to market as such and haven’t gone through extensive QA on gameplay as the focus is demonstrating the URP features. Having said that, we want the sample to work correctly so we are looking into the main issue which seems to do with the timing and how we planned the sequence of pieces falling to be. I will let you know when we have a fix to be tested.

Can you please try replacing these 2 files?
Gem.cs (3.4 KB)
Board.cs (65.7 KB)