Dice throwing system


This week I decided to give a shot into creating the dice throwing system, but in a physical way, different from most games do. Niantic did this pretty well using the pokeball throwing system in Pokémon Go, so I decided that I would like to reproduce this into my game. I also plan to have different gimmicks when the dice hits and enemy before the damage calculation is made, so this system might come in handy.

Generally, in most of the games that I played that use a dice rolling system, they use a RNG system to first generate a number in each dice, then they animate the way this number is shown for the user. I'm going to use a different approach, I'll try to check which die face is upwards when a dice is rolled via a physical-throwing system, using a grab and throw method. My first prototype was using a Hinge Jointt, but the dice was rolling around it's own axis and making the visual weird, so I decided to change it to a Spring Joint and it worked pretty well. 

The Spring Joint also stores a lot of hidden force when you move it  fast, making it easier for the dice to be thrown when the mouse button is released.


As next steps I'm going to upgrade this system to make it able to select multiple dice and also add some random rotation and foces when the dice is released. 

Oh, and I also dropped using Playmaker. It's a good system if you're starting into Unity, but I'm now what we call here in Brazil and "old monkey" (macaco velho) of Unity programming, so I decided that using a visual programming system was going to make it slow for me.

Thanks for reading!

Leave a comment

Log in with itch.io to leave a comment.