Wanna watch this episode earlier? Head over to my Patreon page! www.patreon.com/posts/78779407 This is really my biggest project so far in this channel. It took about two weeks to get it to work in Unity and another two for editing and publishing. I hope you guys enjoy it!
@Juslin7989 Жыл бұрын
Very nice video. GITCG server approved
@ReForgeMode Жыл бұрын
Haha. Thank you! 😄😄
@MountainisFullofDragons7 ай бұрын
thank you. this is literally what ive been searching. it took me over 3 hours to find your vid that solved the exact mechanic for dice that im looking for
@ReForgeMode7 ай бұрын
Happy to help! I've always wanted to make videos like these! 😄😄
@MountainisFullofDragons7 ай бұрын
@@ReForgeMode how did you get the dice to appear from offscreen to on screen? Did you place dice above the main camera?
@ReForgeMode7 ай бұрын
@@MountainisFullofDragons Right, so the Camera is looking directly at the "table" down below. Because the camera field of vision forms a cone, some dice may look to go offscreen as it falls down. I did share this project publicly on Github if you want to check out the full setup. Link is in the description.
@MountainisFullofDragons7 ай бұрын
@@ReForgeMode ah i see, thank you. i think im just gonna move my dice higher up, but everything else has been done the way i wanted it. The important part was rigging the dice for some scripted events I was attempting to do. thanks again man!
@ReForgeMode7 ай бұрын
@@MountainisFullofDragons No problem! 😄😄
@yugiohk574 Жыл бұрын
I took another approach that for my game was easier (also didn't know about the physics simulation but anyway...) The dice is thrown with random forces and rotation, but I dont use any kind of physics detection of which face landed or something like that, instead I lerp between the current rotation to the desired face rotation very quickly, as in my game the dice just bounces of the walls in a high speed, you can barely notice that the dice sometimes rotates backwards and it works just fine haha
@ReForgeMode Жыл бұрын
Hmmm, very interesting! I wonder if there is some degree of uncertainty when the game lags a bit though... I will try to test it myself when I have the time.
@Ferenc-Racz Жыл бұрын
Finally a dev who really understand the game dev, not just know the framework. :) Subscribed now. :) Thank you for the video.
@ReForgeMode Жыл бұрын
Haha, thank you! 😄😄
@ngefy Жыл бұрын
Great video! Really useful information.
@ReForgeMode Жыл бұрын
Thank you! Glad I could help!
@nancywinner Жыл бұрын
Some artifacts (specifically the full set elementals) also guarantee dice rolls. I've gotten full hydro dice rolls with that & jade chamber. I always wondered how it guarentees a roll despite the actual roll looking random, so thanks!
@ReForgeMode Жыл бұрын
Oh yeah! I forgot the artifacts because I rarely played artifacts, haha 😄😄
@Nikinuito Жыл бұрын
Amazing tutorial, well explained, entertaining and easy to follow.
@ReForgeMode Жыл бұрын
Thank you so much 😄😄
@ArksideGames28 күн бұрын
🤯🤯Incredible, Subbed
@ReForgeMode26 күн бұрын
Thank you for the kind words!
@tianqigao869 Жыл бұрын
awesome tutorial! you are so smart!
@ReForgeMode Жыл бұрын
Thank you! Cheers!
@sirixb Жыл бұрын
Amaizing video thanks!
@ReForgeMode Жыл бұрын
Thank you! Glad I could help!
@sbu1028 ай бұрын
Great video, thanks
@ReForgeMode8 ай бұрын
Glad you like it! 😄😄
@iiropeltonen Жыл бұрын
Great technique!
@ReForgeMode Жыл бұрын
Haha, thanks ☺️
@ArielekGames Жыл бұрын
The new ECS physics in Unity are actually deterministic and you could use them for this case 😉 Note: Just not cross platform deterministic, it will yield different results depending on the target platform thanks to inconsistent hardware float implementation (ex. two x64 computers will have identical results with the same setup, but they will be different from the same simulation on android, ios or even web).
@ReForgeMode Жыл бұрын
Oof, I haven't learned ECS yet 😂😂 I am actually waiting for them to complete it first. Who knows when they'll remake it again hehe~ But good to know for future projects
@catpyjamas2 ай бұрын
My question is, how do you know when you have multiple dice? For instance, I have 3 dice. But then I have 4 dice. Four will be different, because they will bump into each other more. Does that mean I have to have separate sets of scriptable object recordings for each potential number of dice?
@ReForgeMode2 ай бұрын
No, it doesn't matter how many dice you throw because it's always the same two dice throw simulation. If they do bounce, they will always bounce the second time. You will only need to adjust the Scriptable Object if you're using a different-sided dice.
@danielebassano7635 Жыл бұрын
Hi, any ideas where can I find the from-to rotation matrix for a 10 sided dice?
@ReForgeMode Жыл бұрын
Well, I mostly write the six sided dice manually without any calculation. I just rotate the dice and find the rotation after for every face.
@danielebassano7635 Жыл бұрын
@@ReForgeMode Thank you very much, I think I'll do the same.
@ReForgeMode Жыл бұрын
Good luck! Do share your project if you finished it! I would like to see what you make of it! ☺️☺️
@Digildon9 ай бұрын
Cool
@kureysalp Жыл бұрын
Only Physics2D have simulationMode. How did you use it?
@ReForgeMode Жыл бұрын
No, 3D rigidbody also has Physics.Simulate and Physics.SimulationMode. For the implementation, check out my github repo in the description of the video!
@kureysalp Жыл бұрын
@@ReForgeMode I got it now, I am using 2021.3 so only Physics2D have that. For who are using 2021.3, you can disable auto simulation, apply force and torque, get the result, rotate the dice, enable auto simulation and apply same force again.
@ReForgeMode Жыл бұрын
@@kureysalp Oh, so it's a new addition? Great! Never used Simulate before, so this news to me. Glad you managed to get it working!
@sirixb Жыл бұрын
@@kureysalp Hi could you help me to achieve this? in Unity 2021.3
@barangursoy56606 ай бұрын
I did the same logic for a 6 sided dice, but whenever in the rotation matrix there is a 270 degrees on X axis, it just gives a wrong rotation result and I don't get the result I want, is this related to gimbal lock, or am I doing something wrong? Thank you for your help and the video!
@barangursoy56606 ай бұрын
Normally, from 4 to 1 it should be (270, 0, 0) in (x,y,z) format right? But it doesn't work, when I tried (90,90,90) for no reason, it worked and I'm always getting 1 whenever the simulation result is 4, how is this working, I'm really confused, why 270,0,0 didn't work?
@ReForgeMode6 ай бұрын
Hmmm... Assuming 1 is at the top, I think a rotation in X means you are rotating the dice upside down, so it's either 3, 1, 4, 6, depending on your dice layout. I'm not sure why it doesn't work, though. It should give the same result if you enter the value into the ScriptableObject. I think I would try to check the dice layout first, and then try to see if the rotation should be -180 < x < 180. So instead of 270, you can just use -90.
@barangursoy56606 ай бұрын
@@ReForgeMode Thank you for your response, -90 didn't work as well but I solved it, I'm writing this so if anyone else faces with the same problem, here is my not so well thought 😅solution: I removed the whole rotation matrix, my dice had 2 on the top as default, and rotation from 2 to all other faces were correct, I solved my problem by this logic: whenever a face other than 2 came, I first rotate them to 2 (default rotation of my dice) then rotate it again with only default rotation's rotation matrix to other numbers, it works perfectly, thank you so much for your quick response and your brilliant solution + video 🤗
@ReForgeMode6 ай бұрын
@@barangursoy5660 Glad you figure it out! Let me know if you need any other help! 😄😄