[SOLVED] Roll dice (RandomInrange starting fast ending slow)

I want to make logic for rolling a dice
Not actual dice but random in range some number

But my idea is is not to change numbers with same exact speed
But like a real dice
Where i click on it and it starts rolling numbers fast
But the longer it rolls the slower it change numbers

I have VERY Fraknenstain solution for it
But i would really wish to avoid it

If that would be forces and i would be moving something with it
I would set some variable to let’s say 200
And subtract 1 from it
And as long as variable is above 0 i would move that object with force of value of that variable

However how the hell do that with random in range and dice you see in bottom right corner?

So i am open to any ideas

You could use a timer to delay the changing of the number to slow it down and increase the timer check value by 1.5 every time the number is changed.

You could tween a value from 1 to 100 using the ease-out-cubic easing function and if the tween value mod 5 is 0 then change the number

I was going to suggest a 3D Box for the dice and spin that in situ using Physics 3D behaviour, but I see the numbers can be greater than 6.

1 Like

Thx
Of course like always i came here to ask question and i went back to events and found my own solution

Which is more or less your 1st suggestion
And it could be 3D but game would not be 3D so that is the problem
Number i roll are 10 because its round number in my eyes

Anyway again thx i believe i manage from now on

1 Like

Ok i found my sweet spot
IF any1 will be looking for same solution

1 - Add additional 0 for it to have longer starting period where it spam it ultra fast

2 - Changing 4 to something lower will shorten the time in which it reaches slow rolling
So changing it to something higher will extend it

3 - When to stop whole spin

I STRONGLY SUGGEST to print that variable to text to actually see what it is

If someone care to try it out
Click on dice to roll
Space to reset scene