Controls: Mouse over boxes starting from green to the orange in order of the path. No clicking required. Clicking will cancel the match and you'll have to retry again. 

This is originally for mobile, so some things might be weird.  There are a total of 4 total patterns(  shaped like  : e, phi, snake, x very similar to some patterns in harry potter). If you finish a pattern, the image will pop back up and grow bigger and fade out. If you mess up, it just reboots the pattern. The box spins in the background mainly for me to see if there are any noticeable frame drops.

I've been playing a lot of Harry Potter mobile lately that I've decided to make a swipe gesture matching thingy in Unity. I am not sure if it is the best way to do it, but I basically just use the image UI and check if the player has moused over it.  It can only be activated if the box (waypoint) previous to it has been touched. So I guess kind of visually like a singly linked list. This might be the easiest way to go about it without some pattern matching algorithm. It just checks if you get the end and some events in scriptable objects trigger and magic happens. 

There are two boxes when trying to match. The big boxes (waypoints) are the important ones you have to mouse over and follow through the path. It starts from the green box first and ends at the orange box. If you mouse over it, it will turn red if you follow the path correctly. The small boxes (fill points) are the accuracy boxes. They will turn green. The order in which they are moused over doesn't matter.

After I clean the code a bit and organize some things, I hope to distribute this and maybe make a youtube series about how this is done. 

Let me know if you have any questions about it! This took me about a week and a half. I'll upload my reference images of me testing out the pattern matching and trying to figure out how I think  the pattern matching works in the Harry Potter mobile game.

Made withUnity

Leave a comment

Log in with to leave a comment.