Made possible by the supporters at:
This is a beginner-friendly tutorial on making a board game in Unity 3d. After we’re done this, we’ll then make an AI that can play against the player!
Make sure to SUBSCRIBE so you don’t miss a video!
Download the project files:
Download the other projects:
Also, please feel free to ask lots of questions in the comments.
This channel is mostly all about game programming tutorials, specifically with Unity 3d. You may also be interested in my primary channel, where I play and review games:
I can be reached at:
quill18@quill18.com
Nguồn: https://suckhoethammy.net/
Xem thêm bài viết khác: https://suckhoethammy.net/game/
Xem thêm Bài Viết:
- Hammer Tutorial V2 Series #15 "Creating a 3D Skybox"
- Kids HocKey HorseShoe Tournament In Canada and Hotel Knee Hockey
- Transformers: Missions – All Deaths Compilation animation [SFM FULL HD]
- Agar.io NEW EPIC TRICK?! DOUBLE + POP SPLIT / SAME SIZE POPSPLIT / IMPOSSIBLE Trick!
- Insane Carnival Game Major Prize Win at Bowler Roller!
Dude, I can't thank you enough. This is an amazing tutorial!
My random number generator gets different number betwen 0 and 15 when i have the range on 0, 2 and i do not understand why.
Code that outputs all dice values:
Debug.Log($"Rolled {string.Join(", ", DiceValues)}, Total: {DiceTotal}");
the first 8mins is talking about what you won't be doing. Goodness. But I'm still hanging on cause I think I'll learn what I'm looking for here. So thanks for doing these.
at about 26:48 he clicks on the "no function" button and there is a dropdown tab that says "diceroller". i am not getting that option. my only option is "MonoScript" anyone know whats goin on here?
RollTheDive!
public int[] dicevalue = new int[4];
Quil18 I need help when I asign on the Onclick buton the rolledice script afther that I cant select the methods of the rolledice script it doesnt apeear on the list only appears: no function and monoscript and inside this name.
emm… actually you can: public int[] DiceValues = new int[4];
You are grammatically sound too mate old chum, 'dice' is actually the plural of 'die'. 🙂
Hey Quill, how did you originally learn to program? I'm wanting to get into game development and I'm currently trying to learn C#, but I don't seem to be making much significant progress. Is there anything you'd suggest?
One question: Is C# 6 supported in this Mono-IDE or Unity? If yes why don't you use Interpolated Strings? ( https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interpolated-strings ) The ugly Debug.WriteLine would become more readable.
What bugs is that min and max for the rng.range() function have different behaviours for different numeric types (namely the max parameter). The thing that bugs me here is "why?"
You can initialize an array in C# where you define it.
You did:
int[4] DiceValues;
But what you want to do is this:
int[] DiceValues = new int[4];
Die vs. dice: I don't have time to look it up again, but I recently read that the new accepted convention is that dice can now refer to what us old-schoolers would call one die. i.e. "Roll the dice!" can refer to a single die (or dice). I'm not positive, though. Look it up.
Translated from a cuneiform tablet, not hieroglyphics. Ur was a Sumerian (and later Babylonian) city, not Egyptian.
yey! Its here!
Loving the series quill. Keep them videos coming!!
You could make most, if not all, of the game objects in Blender.
I made a board game with unity as part of my thesis. Quill was a huge inspiration to this one so here's all the code: https://github.com/xjimdim/Shadow-Hunters (It is a multiplayer facebook game using photon network of tha famous board game: Shadow Hunters). Got some good techniques for the dice in there also 🙂
https://youtu.be/zl93K1bnKgQ
ZigZag in Unity
Not fully watched the video yet, but to work out what side of the dice is up is easy, just use the dices rotation to work out what side is up.
And to stop the dices landing on each other resulting in a dice on an angle just add a bit of a bounce to the object.
That's how I would do it.
good stuff
I did a physical dice game, a version of Farkle/Greedy, in Unity about a year ago. It uses 6 dices and all of them where physically rolled.
If I remember correctly, I determined which face had what value and mapped it all, then I checked which side had a collision and picked the opposite face. No need for "feelers" when it comes to a cube, as the normal detection has 6 values pre-programmed which corresponds perfectly with a 6-sided dice.
It was trickier when I made a 10-sided dice and near impossible using that method for a 20-sided dice, but 6 or fewer were quite easy.
As for the cocked die problem, I sorted that by not using the standard cube, but one that I had beveled the edges of in Blender. If the dice would end up cocked, it simply slid off and landed on a number. Took some fiddling with frictions in the materials, but not too much hassle.
What if when a dice gets caught in another one, you just removed the physics from all the die that have been correctly read. That way it just falls to the table. You could make the maybe pause the physics and animate the other die leaving or just make them transparent, though I see how it could break immersion.
Can ypu do a dnd kind of system? We have dice rolls in yhis game but how about character stats and sheets and stuff?
Love this beginning Unity tutorial, man! Great work!
If possible, it would be cool to take a new look into Unit, especially with turn-based game like this. Or for another project, maybe take a look at creating Unet lobbies with a minigolf type game?
MOOOREE VIIDEEEOOOSS :d