2D Sonic Pachinko

Mouse Control Only

I'm working my way through some of the Unity Pathways so that I have some official certifications and such to point to in the future. The first one I made was an infinite ball runner thing, but its not really that impressive. It does similar things to this, but if you wanna see that, you can check out my Unity Learn page.


This micro-game/project was a simple pachinko "game". Its more of a scene, and it didnt have to loop or anything, but I figured I know how to do at least that much, so I ought to make it infinitely playable.

There are a few things I could do to really make this an actual "game", so I might come back and finish it up and give it the last bit of polish it needs to be a minimum viable product or whatever. I really only did this for the certifications, but I do love me that blue hedgehog.

Nevertheless, this was fun and good experience, as it took far less time than I expected it to. Im really starting to get confident in my abilities and even if I come across a hiccup, I find im getting better at finding solutions.

Controls:

  • Left Mouse Button - Start Pachinko Attempt


Most of the code is my own, only having needed to look up additional information on the Unity docs. 

Here is the main script for the scene: https://pastebin.com/piUHPqCv

The other scripts are dead simple, just responding to trigger colliders and playing animation clips.

One challenge I wasnt sure I was going to be able to solve was fine-tuning the physics settings to make sure the collision detection worked even when Sonic was going really fast. On the default settings, I found sometimes the bumper animations wouldnt play—I was able to solve this by raising the "Baumgarte scale" in the project settings to 0.5. They still sometimes dont work, but its better than before.

For the goal post animations, I just split a sprite sheet I made into 3 pieces and changed the sprite over time. That was a lot simpler than I thought it was going to be.

Finally, I found that the default build settings for WebGL prevented the game from loading on Unity Play, but I found a solution on this forum post that worked wonders! A lot of the submissions on that site are not optimized in this way and you cant really play the games.

Download

Download
2DSonicPachinko.unitypackage 2 MB

Install instructions

  • Unity 2022.3.13f1
  • Includes my Affinity Designer asset files

Leave a comment

Log in with itch.io to leave a comment.