How to create simple Dice Tossing game with Unity? Dice Roll Easy Unity 2D tutorial.

  Рет қаралды 71,132

Alexander Zotov

Alexander Zotov

Күн бұрын

Пікірлер: 83
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
Hi everyone! You can help me by sharing this video if you like it) Thank you for watching!
@monstereugene
@monstereugene 2 жыл бұрын
good news this vid is about to blow up because of beginners like me thank gmtk
@daddymccarthy
@daddymccarthy 2 жыл бұрын
GMTK 2022 brought me here
@SouthHill_
@SouthHill_ 2 жыл бұрын
Good luck, mate!
@lukedeets5016
@lukedeets5016 2 жыл бұрын
Haha! I’ve been trying to get this die to give me it’s value for the past 4 hours!
@kaotic-chip4617
@kaotic-chip4617 2 жыл бұрын
@@lukedeets5016 me to have you managed to fix it
@SpiritowlTV
@SpiritowlTV 6 жыл бұрын
you can also do this by sending raycasts outwards of the faces and getting the dot product of the direction of them and vector.up. giving you the result.
@Pur_Cell
@Pur_Cell 3 жыл бұрын
I was thinking loop through all the side checker objects and see which one was highest
@SpiritowlTV
@SpiritowlTV 3 жыл бұрын
You know that is actually a great idea. Wish I did it that way.
@artisrozentals5853
@artisrozentals5853 5 ай бұрын
Thank You! Your helped me more then Copilot. His solution was a lot more complicated involving vector dot products etc. And still giving me not 100% accurate results. It was funny that dice rolled 5, but script said it is sometimes something else. 😀
@willichillmann9463
@willichillmann9463 4 жыл бұрын
Thank you very much, worked very well! In the end, I had to adjust the diceCheckZone as I placed it too high so that the wrong numbers were displayed - just in case someone faces similar problems. Great tutorial, thank you so much! Scripts also worked very well.
@mkfive1000
@mkfive1000 Жыл бұрын
Thank you. This video was very helpful to me.
@kunalsingh-wb1ju
@kunalsingh-wb1ju 4 жыл бұрын
Great tutorial! Solved half of my problems. Thanks!
@nv7287
@nv7287 5 жыл бұрын
Awesome thanks so much :) now rolling my little dice happily :)
@AlexanderZotov
@AlexanderZotov 5 жыл бұрын
:-)
@MillyStories
@MillyStories 6 жыл бұрын
thnks, actually there´s one on the asset store but very buggy, and this one is simpler to implement, keep the good work
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
Thanks for your feedback!
@ekzac
@ekzac 4 жыл бұрын
2 years old tutorial, still very good :) But now there is one asset in the Asset Store they used in One Deck Dungeon. I must admit, it is pretty funny to play! =)
@JeffreyHamlin
@JeffreyHamlin 3 жыл бұрын
Works great, consistently rolls same number but that is expected I guess. Tried varying the bounciness and angle of the die, it's not random enough. I think if I add a second dice that collides I will get more random results.
@bheemnegi3229
@bheemnegi3229 2 жыл бұрын
Great content @Alexander, thanks. Wanted to know if this tutorial is for a 2D game or a 3D game ?
@Neerajkumar-mc7wk
@Neerajkumar-mc7wk 4 жыл бұрын
When I press space for the first time its okk but when I press second time position of x,y,z keeps increasing also rotation increases.
@theshizon
@theshizon 4 жыл бұрын
How do I modify the code to roll 2 dice and add the values together?
@cikselizabeth
@cikselizabeth 2 жыл бұрын
I get the null reference error on the line text.text = diceNumber.ToString (); Can you help me?
@kimkaye1712
@kimkaye1712 2 жыл бұрын
Question: I'm trying to make a pre-determined value to roll a dice. Any tips on how to do it?
@critcheese1411
@critcheese1411 4 жыл бұрын
Very helpful. Thank you
@estebanvanegas3718
@estebanvanegas3718 6 жыл бұрын
Hey, Alexander. What if I want to ad an specific image to each of the dice sides?
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
Hi! Then you have to create a new texture in Photoshop or Gimp with different sides colors.
@himanshutripathi3324
@himanshutripathi3324 2 жыл бұрын
Sprite renderer does not show in canvas . Please tell me how to roll dice in canvas
@SuperCarzetin
@SuperCarzetin 6 жыл бұрын
hi!! thanks for the tutorial, but i have a question... how can i do if i have 2 dices? how can i add both dice numbers to obtain one number in the screen? Thanks man!!
@isaacmort253
@isaacmort253 2 жыл бұрын
Yes I am wondering about this as well!
@flowconstruct
@flowconstruct 2 жыл бұрын
if u want to have a total just make a sum function with the two different dice and connect it do the UI whatever u name them then will go "whateverdice1"+"whateverdice2"
@sadbutnotbad
@sadbutnotbad 5 жыл бұрын
Thanks for tutorial. If i want to roll few dice objects, how to summ their numbers?
@гугушка-т5й
@гугушка-т5й 6 жыл бұрын
Perfect tutorial! Thank you very much!
@seanpham7248
@seanpham7248 2 жыл бұрын
Anyone know how to creat a dice in 3d unity. . I am working dice game but dont know how to create 2 dices for my game
@zanerTEEVEE
@zanerTEEVEE 4 жыл бұрын
Hey! I dont know if youre active still but what would be the best way for me to have it print certain questions instead of numbers?
@QD808
@QD808 6 жыл бұрын
keeps saying that its not expecting static?
@paulpopSignatur
@paulpopSignatur 2 жыл бұрын
Great video Thank you. Does anybody how do I assign a UI button to roll the dice again instead of the Spacebar ??
@walney2008
@walney2008 5 жыл бұрын
hi, you speak game sinuca, billiard ? style 8 BALL POOL ? tnkhs
@dismal368
@dismal368 6 жыл бұрын
thanks, awesome tutorial, so usefull, maybe you can make a Slot machine unity 2018 tutorial C# ?
@AlexanderZotov
@AlexanderZotov 5 жыл бұрын
Did one!
@greenbear9790
@greenbear9790 4 жыл бұрын
this is really awesome! simple and nice tutorial!! I want to use more than two dice, what should I do in that case? I made a small check box for each dice and had it follow the x,z coordinates of the dice. it worked but, this method has become complicated when calculating the sum of the values of each dice(like in case the number of dice thrown is random.) Is there any other way you recommend? i would really appreciate if you reply me
@tzachcohen9124
@tzachcohen9124 7 жыл бұрын
col.gameobject.name recognizes the name as dice and not as side1 or side 2 etc. how do I solve this?
@tzachcohen9124
@tzachcohen9124 7 жыл бұрын
Still not working, sometimes it gives the name of the cube and sometimes it gives the name of another collider EDIT: NVM, I got it finally! Listened more carefully and done it! thank you so much
@tzachcohen9124
@tzachcohen9124 7 жыл бұрын
I tried to do a workaround and put the collider above so it gets the upper side, didn't work. In the beginning I put it on the same plane with the floor, didn't work. So finally i tried to put it under the floor, and it worked 😀
@TheGryphonGamer
@TheGryphonGamer 2 жыл бұрын
The dice just falls all the way through the box collider, can someone help me please It doesn't work
@hassannashi3169
@hassannashi3169 6 жыл бұрын
if i want another dice what i do?
@kareemismael6153
@kareemismael6153 7 жыл бұрын
Thanks for the great video.. So what if I want to show the number for two dice or more. What should I do? (Say show the number for both dice side by side like 6 - 2 or 3 - 5)
@nsahandler
@nsahandler 5 жыл бұрын
I hope you've solved this already on your own... You can literally clone the object and then have the output reader run Dice1 + Dice2
@aminanaseer6801
@aminanaseer6801 7 жыл бұрын
after downloaded the model and scripts from the description link how can i import it in unity could anyone help me in that issue??
@appsgames6921
@appsgames6921 6 жыл бұрын
just drag and drop each object individually.
@BenjaReaper
@BenjaReaper 2 жыл бұрын
If you just name your sides the opposite number, you can instead of the switch use diceNum = int.Parse(other.gameObject.name);
@noticeme503
@noticeme503 5 жыл бұрын
Спасибо! То что нужно.
@AlexanderZotov
@AlexanderZotov 5 жыл бұрын
Пожалуйста!
@garrychernoff6360
@garrychernoff6360 6 жыл бұрын
Hi, it's a great job~~ If I want dice show my custom number? exp: showDice(5); how do? Thanks~
@nsahandler
@nsahandler 5 жыл бұрын
You have to make the model manually and either map it or create it as an object to be imported into Unity and given physics/behavioral dimensions. You could edit the modeled file he included in his download, if you have photoshop or other modeling tools, or even make your own image and make that the image plane of the box. Multiple ways to do it.
@Agentti_Kowalski
@Agentti_Kowalski Жыл бұрын
my dice only goes to transform position but does not move in any other way
@n.aclasheryt4802
@n.aclasheryt4802 7 жыл бұрын
Will it work fine with a 2d effect??
@n.aclasheryt4802
@n.aclasheryt4802 7 жыл бұрын
Alexander Zotov its in 3d, i mean will this work if i just turn the camera up?
@n.aclasheryt4802
@n.aclasheryt4802 7 жыл бұрын
Alexander Zotov ok
@shh9262
@shh9262 6 жыл бұрын
I'm dysfunctional right now. When I hit the S-Pause button, the dice hit the ground and it starts to spin on its own, and every time I press the S-Pause button, its spin speed increases and the numbers do not show up.
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
Oh. Hard to say just like that. There are lot of what can be wrong in your project. On the other hand it can be small mistake that ruins everything)
@zombiegamer1069
@zombiegamer1069 2 жыл бұрын
there is a problem with the script?? it keeps crashing
@zombiegamer1069
@zombiegamer1069 2 жыл бұрын
nvrmind the script name had a space in it
@shh9262
@shh9262 6 жыл бұрын
I'm having to press the button until it falls to the ground and starts to rotate. Where is the problem, please. Please
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
May be you typed if (Input.GetKey(KeyCode.Space)) instead of if (Input.GetKeyDown(KeyCode.Space)) in DiceScript?
@chuasunghui6812
@chuasunghui6812 4 жыл бұрын
When i hit run, the text remains 0 all the time .....
@iliachernoskutov1232
@iliachernoskutov1232 7 жыл бұрын
spasibo
@TheGreatestHeroEver
@TheGreatestHeroEver 6 жыл бұрын
I'm getting error "Unexpected symbol 'DiceNumberTextScript'. I've written the DiceCheckZoneScript as in the tutorial. What am I missing?
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
Check curly brackets and semicolons.
@TheGreatestHeroEver
@TheGreatestHeroEver 6 жыл бұрын
Thank you for the quick reply! It was the names of the dice sides that didn't match the script! Awesome tutorial! How would you do it with two die, and add the number rolled to a value? E.g. add the rolled number to a player's health.
@ScholarshipNetworkprofile
@ScholarshipNetworkprofile 5 жыл бұрын
very nice tutorial i will sub and like, feedback: maybe a bit better time management, also this video could have been 3 parts (toss/detect/display).
@SnayteLeRoi
@SnayteLeRoi 3 жыл бұрын
when I start my counter remains at 0
@karampalsingh5914
@karampalsingh5914 3 жыл бұрын
WAHEGURU JI DA KHALSA JI WAHEGURU JI DI FATEH JI WAHEGURU JI WAHEGURU JI WAHEGURU JI WAHEGURU JI DHAN GURU NANAK JI DHAN GURU NANAK JI
@shh9262
@shh9262 6 жыл бұрын
Oops, this program really has a major problem. Please post the correct application
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
What is it?
@HAS_72
@HAS_72 Жыл бұрын
2D???
@n.aclasheryt4802
@n.aclasheryt4802 7 жыл бұрын
👍👍👍👍
@yagamy3071
@yagamy3071 10 ай бұрын
Помогите пожалуйста кто то, ничего не работает
Recreating Genshin's Rigged Dice Roll in Unity (Deterministic Dice)
8:59
ReForge Mode - Unity Tutorials
Рет қаралды 5 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
9 EASY Steps to create a multiplayer game with Unity & Photon - Tutorial
15:51
Making a Game About Weak Points
21:27
Emis
Рет қаралды 368 М.
How to make a HEALTH BAR in Unity!
21:06
Brackeys
Рет қаралды 1,2 МЛН
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 547 М.
How To Make A 3D Character For Your Game (Blender to Unity)
13:40
Jelle Vermandere
Рет қаралды 1,2 МЛН
I made a full GAME in 400 HOURS - this is how - in 19 minutes!
19:00
How I learned Unity without following tutorials (Developing 1)
18:11
Game Maker's Toolkit
Рет қаралды 2,1 МЛН
Unity 5 Tutorial: Physical Dice
37:59
xOctoManx
Рет қаралды 30 М.
MELEE COMBAT in Unity
21:07
Brackeys
Рет қаралды 1,6 МЛН