Ultimate Dice Mechanic

Two Bit Studios - Blueprints - Jun 25, 2024

A fully featured dice system, including procedural dice, roll system, and a value reader.

  • Supported Platforms
  • Supported Engine Versions
    5.2 - 5.4
  • Download Type
    Asset Pack
    This product contains an assortment of Unreal Engine assets which can be imported into a pre-existing project of your choice.
Ultimate Dice Mechanic

This asset is for those looking for more than just a dice model, or a dice-throwing system. The ultimate dice mechanic includes procedural dice generation, dice rolling/throwing, reading dice values, and auto rethrow. All while being the easiest to customize!

IMPORTANT [Read to Get Started]: UltimateDiceMechanic/README.md at main · rohithateappple/UltimateDiceMechanic (github.com)

Documentation: https://drive.google.com/file/d/1Lq5H3exkEd90Y1o6m4JelzUB4V7ydQvY/view?usp=sharing

Trailer: Ultimate Dice Mechanic | Unreal Marketplace (youtube.com)

Why procedural dice?

Traditionally a dice game only has 6 values to play around with (numbers 1 - 6). Each face of the die is guaranteed to have unique values (i.e., no two faces have the same value). Thus, there's only ever a need for one dice model. But what if your game has more than just 6 values and on top of that what if the face values aren't unique? Well, now you'll need to model many variations to account for all those unique combinations.

Having the traditional 6 values per face, you'll need to manually create this many 3D models: 6^6/24 = 1944.

As the number of values increases, the number of possibilities also increases. That's where the procedural system comes into play. You just need to map all available values to their respective materials and the system puts together a dice with 6 random values. The result? Eventually, you'll have covered every possible die variation!

Regular Dice

Not all devs require procedural dice. And for that reason, this mechanic also comes with a regular die. Changing values is the same as the procedural, this time there's no need for materials as the user already has a model. Simply change values corresponding to each collider in the data table.

Spawning and Throwing

The BP_DiceManager handles the spawning and throwing of dice. Press 'SpaceBar' to spawn and throw at the same time. By default, the spawn mode is set to spawn in the area.

Shooting Dice from Actor

The BP_DiceManager can also shoot dice from a specified actor. It shoots the dice in the forward direction with an offset to its world location. This avoids clipping artifacts.

Shooting Dice from Player

Want to shoot the dice like a gun? You can do that! Simply tick the 'Shoot from Player' checkbox, and now you can attack your enemies with... dice?

Customizing the Die

There are two different methods to customize your die:

  1. Procedural Customization.
  2. Regular Customization.

For Procedural Customization you'll need the following:

  • Materials that correspond to each value in your game.
  • *Optional: A custom frame mesh.
  • *Optional: A custom face mesh.

*Custom frame and face are only required when opting for the custom body procedural die.

You can then use the pre-provided procedural data tables to assign each material to its value. Once assigned, use that data table as the procedural source in the BP_DiceManager.

For Regular Customization you'll need the following:

  • *Optional: A custom die mesh.

*Custom mesh is only required when opting to change the default die mesh.

You can then use the pre-provided regular data tables to assign each collider to its value. Once assigned, use that data table as the regular source in the BP_DiceManager.

Technical Details


  • Two base dice classes - BP_RegularDie and BP_ProceduralDie
  • BP_ProceduralDie - Generate every possible face-value combination, from the user-defined data table.
  • BP_RegularDie - Use your own dice mesh and set face values in the data table.
  • BP_DiceManager - To spawn, throw, and read values of dice.
  • Side Landing Check - Checks if a dice has landed on any of its sides, to avoid bad line traces.
  • Auto Rethrow - Rethrow an individual dice, if the side landing check is on and the dice hasn't landed.
  • Easy changing of values in the data table means good scalability across multiple spawns.
  • Easy roll physics tweaks like impulse, impulse radius, etc.
  • Automatically read values when a dice has stopped rolling.

Number of Blueprints: 8

Input: Keyboard

Input Commands:

  1. Space Bar - Spawn/Throw Dice
  2. H - Activate/Deactivate Spawn/Throw at the cursor location.

Network Replicated: No

Supported Development Platforms:

Windows: Yes

Mac: No

Documentation: https://drive.google.com/file/d/1Lq5H3exkEd90Y1o6m4JelzUB4V7ydQvY/view?usp=sharing