Coding a Dice to Roll random number


#1

Trying to figure out how to code a Dice to roll and randomly land on one side. Not sure what coblock function to use. Any tutorials out there? Thx


#2

Here’s my attempt.
I put in a target anchor for the dice. Then when you click on the dice it is pushed towards the target with random rotations.


#3

Thanks…but can you show me the code? I’m still hitting my head here.


#4

That’s probably simpler than the one I made! I created a random series of invisible blocks and the dice is pushed toward each one with random velocities then resets to the beginning.


#5

Here is my attempt. It works fairly well, but might be overly complex compared to the above version. This space is remixable so you can check out the code. https://cospac.es/amle

It still produces a few duds (not totally sure why, might just need to increase the velocity ranges)


#6

Here’s my dice roller space. You can remix so go nuts and pull it apart. :slight_smile: