ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
Minecraft Crafting System in Unity!
ฝัง
- เผยแพร่เมื่อ 9 ม.ค. 2020
- ✅ Get the Project files and Utilities at unitycodemonke...
Let's make a Crafting System like the one used in Minecraft, define Recipes, place Items and get the Output!
Take a piece of Wood to make a Stick, one Stick and 2 Diamonds to make a Diamond Sword!
Then use it with the previously made Weapon Equip System to Equip the Sword!
Crafting Items with Scriptable Objects!
• How to Craft Items wit...
Make your Games Designer Friendly! (Scriptable Objects)
• What are Scriptable Ob...
Simple Inventory System in Unity (Store, Use, Stack and Drop Items)
• Simple Inventory Syste...
Simple Drag Drop
• Simple Drag Drop (Unit...
How to Equip Weapons and Items in Unity (Drag Drop, Inventory)
• How to Equip Weapons a...
Grid System in Unity (Heatmap, Pathfinding, Building Area)
• Grid System in Unity (...
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
📍 Support on Patreon / unitycodemonkey
🤖 Join the Community Discord / discord
📦 Grab the Game Bundle at unitycodemonke...
📝 Get the Code Monkey Utilities at unitycodemonke...
#unitytutorial #unity3d #unity2d
--------------------------------------------------------------------
Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.
I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
You can see my games at www.endlessloopstudios.com
--------------------------------------------------------------------
- Website: unitycodemonke...
- Twitter: / unitycodemonkey
- Facebook: / unitycodemonkey
This video was very tough to make so I really hope you like it! What are you going to craft?
🎮 Play 7 Awesome Games (Action, Strategy, Management) and Help Support the Channel!
✅ Get the Game Bundle 67% off unitycodemonkey.com/gameBundle.php
I think the ability for the player to craft food and/or drink/potion is something that can be applied to many games, because a lot of creatures can't be without them in real life too.
I actually got this as an ad and I watched this and didn't even watch the video that I wanted then to watch
Dang nice tutorial, man.
Your tutorials are so helpful in giving me inspiration. Watching this has made me confident enough to start a project that I
have been wanting to do for a while now, but wasn't sure how to compare items to another. And the Dictionary is just brilliant.
Thanks again. Always appreciated.
You Rock!
Awesome! Best of luck!
Thanks for this video. Just 200 left for touching the milestone of 100k. Please make a new tutorial series of making an RPG game from scratch.
im in your discord server (By the way you are a really underrated dev and youtuber)
keep doing what your doing man (also what do u use to make the characters and maps for your game im new to devvelpoing)
Thanks!
For drawing I use Photoshop but you can use any image program you have like Paint or Gimp.
I have been looking for a tutorial like this for days! Thanks a ton, subscribed!
You've no idea how helpful these are. Liked, subbed and commented. Thank you kind sir and keep it up
Glad you liked it!
Man you pump these vids out quick :D
Heh yup pretty intense but I love making all these various systems!
the perfect tutorial doesent exi-
noo thats not how you make sticks xd
Heh yeah I know, first Planks and then Sticks but I wanted to simplify it for the video and it made more sense to start with Wood.
Another very cool system that can be tailored for your needs.
Amazing!!! I love these videos, keep up with the good work :)
If you craft several sticks first, then go to craft a stick with other sticks in any of the other unused crafting slots, they will also be consumed with the crafting of a single new stick.
YAY 100K SUBS !
again very good content, you're quite on fire these days !
Thanks! Glad people like the videos!
now 200k
Very nice tutorial. I would really love for you to implement this with player stats system. Would that be possible in a future tutorial?
Player stats how? Can only equip the sword when the character has enough STR? Or equipping the sword increases Attack?
Code Monkey both actually. I have played games like “Archero”, and it implements those features very well.
Id love to see any tutorials on VFX graph (especially mobile focused)
Yeah I haven't touched it yet but I do want to try it out especially as it comes out of preview
Congratulations to 100k subscribers!!!🎊🎉🎊🎉🎊🎉🎊🎉🎊
Thanks! Pretty insane number!
Amazing Tutorial as usual , Thank you so much.
I wanna ask you for a favor Sir , Could you please make a tutorial for mobile input to controll the characters in your projects . That's will help us to much .
Thank you so much again :))
Awesome content. Thanks for continuing to share your knowledge.
Thank you for your amazingly awesome tutorials
You keep referring to previous videos that this is built on. Is there a playlist I can watch straight-through to learn all these in order?
They are all linked in the description. Each system is mostly standalone so there isn't a guided path specifically for getting to this system.
Loved it! Can you make a tutorial similar to this but with items that take up more than 1 square?
Being able to drag a 2x1 rectangle on a 3x3 grid and have it snap to it would be a dream come true. Please do a follow up implementing this I beg you
Yeah I've been meaning to do a video on a Tetris style Inventory system but it's pretty complex so haven't had the time to do it yet, hopefully soon!
@@CodeMonkeyUnity I absolutely adore those kind of inventory systems and I cannot for the life of me figure it out. Thank you so much for the reply :)
0:08 yes this is the first thing i do when i craft a sword,
Nice video. I have a question. Is there any advantage in using EventArgs instead of an event Action for dispatching events?
It's simply the standard to use EventHandler with EventArgs, it would work exactly the same with Action
Watch accross your video. Far different from brackeys' tutorials. Codes are too much, and basically all things are managed from codes. You both have different mechanics for a same game function, but brackey‘s one is more beginner friendly and very easy to understand. Maybe I am not getting used to, but I really don't understand the code, too advanced for me, for a beginner, in my opinion. No offense, peace.
Yes I am mainly a programmer so I tend to do most of it through code. However when going the more visual route it will work at first but you will end up with a messy codebase and be unable to progress and continue making more complex games.
If all you want is a prototype then use whatever method you prefer, but if you're starting a game you will work on for months you should really think very carefully about how you implement things rather than going with the very first approach that comes to mind.
This is a very nice way to see how it works!
Thank you man
Yhis is underrated channel
Hey, I really like your videos, as a teenager I used to make games as a hobby, now I work as a software engineer, and your videos made me consider go back to unity. So amazing work with your content. Could you make a swimming system. I remember, is something was really tough when I was a teenager, I would like to know how would you do it.
PS: ECS Videos are amazing
Great video as usual, thanks!
Any reason you're using event handlers over actions? For the named args? Habit?
Just because it's the standard. When I first learned about events I thought you had to use EventHandler and by the time I figured out you could use Actions I decided to just stick with the accepted standard.
Gg on 100k
Thanks! Glad people like the videos!
Don't Know if u are going to see this. But there is a bug. If u try and move item inside crafting gui and let it go while you have moved item just a little bit it duplicates.
Another issue is that i can't add multiple recipes for a same item.
Thank you for the video!
a genius and a madd ladd
When I make this build for android, I can move the items around inside the inventory but cannot place it into the crafting grid. Could someone please help out
Love the video but quick question do you have a the UI_Item script? trying to see how this works and practice some of this stuff for my own implications but unsure about parts you don't show, also i followed your drag and drop tutorial but i've run into a couple placement issues and having items snap to container boxes.
I think i pulled the UI_Item to be the ItemWorld Script from your inventory video? However I am now running into issues with getSprite, when creating an item on the crafting board it throws me an error saying object reference not se to an instance of an object with the line within GetSprite that sets the items sprite as the place of issue, however i am not sure what value here is null as both the item given is detected and the sprite that should be there is in the correct slot
It's been a very long time since I made this video but the project files should have everything
If you have something null use Debug.Log unitycodemonkey.com/video.php?v=5irv30-bTJw
I am having an issue at around 8:55. The wood sword is the same size as the other objects and is not stretching to fill the output slot. Do you have any idea what could be causing this?
It depends on the size of the texture and the pixels per unit in the texture import settings
Nice
4:50 line 47 is redundant, just return false there instead of the else
He probably knows that already 😂
@@maarten1012TTT yep but it always bothers me when people do
if true
return true
else
return false
It is redundant but makes the code more explicit and easier to follow. Without the else you would need to spend an extra 100ms looking at the code to make sure there were no other paths.
@@CodeMonkeyUnity maybe its just me but for me my way is easier to follow and read. Just like return var is better than if var return true... so on. Also your code always relies on your package so i dont learn much from your video. Thank you for the reply and i hope you dont see this as hate
how are you dragging items
I covered drag drop here th-cam.com/video/BGr-7GZJNXg/w-d-xo.html
How can you make a shapeless recipe, like not having to place the two wood blocks in the MIDDLE to get s stick?
So you can place them anywere as long as they are on top of each other?
Scart3 Redup one way with this particular system in the video would be to make a recipe for all possible combinations. It would eg. make 6 recipes for the same stick output.
If you want it another way you'd have to change the code for recipes and that tries for recipes to only send the filled slots and compare against recipes which also only defines the slots needed to be filled regardless of position on the grid.
That is a completely different design which would require completely different logic.
Instead of defining recipes as specific positions on the grid you would need to define then as items in positions relative to other items.
So maybe define a recipe with a list of recipe items each holding its type and the type above/blow/left/right
Hi CodeMonkey, I'm Stuck at 5:48, when I run crafting test I get this error
NullReferenceException: Object reference not set to an instance of an object on these lines
inventory.OnItemListChanged += Invetory_OnItemListChanged;
uiInvetory.SetInventory(playerInventory.GetInventory());
I've seen your NullRef error video, I stull can't figure out what's worng. Pls help.
If the error is on the first line, then inventory is set to null, use Debug.Log to confirm
Seems like playerInventory.GetInventory() is returning null
now can you make furnace?
any reason for leaving ',' in arrays?
Plz a video on chest inventory
What do you mean? The inventory class can represent anything, a chest, player equipment, world inventory, etc
th-cam.com/video/2WnAOV7nHW0/w-d-xo.html
It seems easy with you.
That's what you get with 20 years of Programming and 10 years of Game Development!
Keep at it! Experience is key!
How can i make that 360 sword attack
In which video you created the UI_Item class?
In the Inventory System th-cam.com/video/2WnAOV7nHW0/w-d-xo.html
Do you have the base code of the project? (only the character and the background) I Downloaded the project files but it seems that is the final version and also with compiling errors :(
What compiling errors? The project files contain the fully working final state of the video.
@@CodeMonkeyUnity In a new project (in 2019.3.0f6), I just import the package and i get this two errors (I tried with 2019.2.8f1,
Assets/CraftingSystem/Inventory/Scripts/ItemWorld.cs(4,42): error CS0234: The type or namespace name 'LWRP' does not exist in the namespace 'UnityEngine.Experimental.Rendering' (are you missing an assembly reference?)
Assets/CraftingSystem/Inventory/Scripts/ItemWorld.cs(29,13): error CS0246: The type or namespace name 'Light2D' could not be found (are you missing a using directive or an assembly reference?)
@@josevalenzuela4540 You need to install the Lightweight RP in the Package Manager
Please, you can Russian subtitles, because I'm Russian and I'm not very comfortable watching your beautiful lessons. I hope you'll do the subtitles, and while I'm waiting, I'll watch the lessons. Thank you in advance
You can use the auto translate which should work most of the time
Hi ! I have been watching you for 1 month and i want to buy a laptop to develop 2d games like you. Do you use a laptop ? If you use one, what is in it ? I found a laptop which has 8th gen i5, 8gb ram, 256 gb ssd and mx130 gpu. Can i develop 2d games with this system or do you think i need a stronger one.
Just about anything can run Unity so yes those specs will work just fine.
@@CodeMonkeyUnity do you use laptop which one
Is it possible for a beginner to understand the code?
This is a pretty complex system so if you're a complete beginner you should start with something more basic.
However by all means to watch the video and try your best to understand, even if you can't follow all of it you will be exposed to more advanced concepts that you will eventually learn.
What is the list of videos to get here?
There's links in the description, the main one being the Inventory System th-cam.com/video/2WnAOV7nHW0/w-d-xo.html
Yayyy... you forgot about planks.
Heh yeah I know I wanted to simplify it for the video and it made more sense to start with Wood rather than Planks
how can i learn java to make games
Java isn't really a very good language for making games, there aren't many engines that use it.
You're better off learning C# or C++
@@CodeMonkeyUnity thx
if (fan_of_JMonkey) { Learn("Java"); } else Learn("C#" || "C++);
i cant download the UTILS
Why not?
Usual video 60 - 130 likes, video about minecraft - 250................................
someone created a mess on ur server
No, this is not Minecraft style crafting
Why not? What's missing? I expanded upon the recipe system here th-cam.com/video/E91NYvDqsy8/w-d-xo.html
you should make course from udemy
Your know how to make a 3d game 🤔🧠
Most of the videos I make are independent of dimension, you can use this system in either 2D or 3D