ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

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

ความคิดเห็น • 111

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  4 ปีที่แล้ว +30

    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

    • @mr.fakeman4718
      @mr.fakeman4718 4 ปีที่แล้ว

      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.

    • @Dariwoos
      @Dariwoos 4 ปีที่แล้ว

      I actually got this as an ad and I watched this and didn't even watch the video that I wanted then to watch

  • @jameslavery2958
    @jameslavery2958 4 ปีที่แล้ว +8

    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!

  • @rahulkumarjha2404
    @rahulkumarjha2404 4 ปีที่แล้ว +6

    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.

  • @therealman8041
    @therealman8041 4 ปีที่แล้ว +6

    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)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +3

      Thanks!
      For drawing I use Photoshop but you can use any image program you have like Paint or Gimp.

  • @T33nno
    @T33nno 4 ปีที่แล้ว +5

    I have been looking for a tutorial like this for days! Thanks a ton, subscribed!

  • @Tengzhichong
    @Tengzhichong 4 ปีที่แล้ว +3

    You've no idea how helpful these are. Liked, subbed and commented. Thank you kind sir and keep it up

  • @juicedup14
    @juicedup14 4 ปีที่แล้ว +5

    Man you pump these vids out quick :D

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +3

      Heh yup pretty intense but I love making all these various systems!

  • @viktorajvazi7728
    @viktorajvazi7728 4 ปีที่แล้ว +26

    the perfect tutorial doesent exi-

  • @theZech
    @theZech 4 ปีที่แล้ว +34

    noo thats not how you make sticks xd

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +6

      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.

  • @speedrob
    @speedrob 4 ปีที่แล้ว +2

    Another very cool system that can be tailored for your needs.

  • @ROQuietStorm
    @ROQuietStorm 4 ปีที่แล้ว +3

    Amazing!!! I love these videos, keep up with the good work :)

  • @sklanman
    @sklanman ปีที่แล้ว

    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.

  • @medmel2160
    @medmel2160 4 ปีที่แล้ว +3

    YAY 100K SUBS !
    again very good content, you're quite on fire these days !

  • @davekene
    @davekene 4 ปีที่แล้ว +4

    Very nice tutorial. I would really love for you to implement this with player stats system. Would that be possible in a future tutorial?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +1

      Player stats how? Can only equip the sword when the character has enough STR? Or equipping the sword increases Attack?

    • @davekene
      @davekene 4 ปีที่แล้ว +1

      Code Monkey both actually. I have played games like “Archero”, and it implements those features very well.

  • @aqua_pi
    @aqua_pi 4 ปีที่แล้ว +2

    Id love to see any tutorials on VFX graph (especially mobile focused)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +2

      Yeah I haven't touched it yet but I do want to try it out especially as it comes out of preview

  • @user-yh8hh9cy3k
    @user-yh8hh9cy3k 4 ปีที่แล้ว +1

    Congratulations to 100k subscribers!!!🎊🎉🎊🎉🎊🎉🎊🎉🎊

  • @chariouibouchaib4416
    @chariouibouchaib4416 4 ปีที่แล้ว +4

    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 :))

  • @MosphereMusic
    @MosphereMusic 4 ปีที่แล้ว +1

    Awesome content. Thanks for continuing to share your knowledge.

  • @jonathankingsland3070
    @jonathankingsland3070 4 ปีที่แล้ว +1

    Thank you for your amazingly awesome tutorials

  • @rmt3589
    @rmt3589 ปีที่แล้ว +1

    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?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +1

      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.

  • @AyyyyyyyyyLmao
    @AyyyyyyyyyLmao 4 ปีที่แล้ว +2

    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

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +2

      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!

    • @AyyyyyyyyyLmao
      @AyyyyyyyyyLmao 4 ปีที่แล้ว +1

      @@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 :)

  • @stacyardus3898
    @stacyardus3898 4 ปีที่แล้ว +3

    0:08 yes this is the first thing i do when i craft a sword,

  • @hojaverde5265
    @hojaverde5265 4 ปีที่แล้ว +1

    Nice video. I have a question. Is there any advantage in using EventArgs instead of an event Action for dispatching events?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +2

      It's simply the standard to use EventHandler with EventArgs, it would work exactly the same with Action

  • @CharmFlex
    @CharmFlex 4 ปีที่แล้ว +3

    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.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +7

      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.

  • @hiddenalien
    @hiddenalien 4 ปีที่แล้ว

    This is a very nice way to see how it works!

  • @ilijafullgamer9
    @ilijafullgamer9 4 ปีที่แล้ว

    Thank you man
    Yhis is underrated channel

  • @victorprado9276
    @victorprado9276 2 ปีที่แล้ว

    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

  • @Pookzob
    @Pookzob 4 ปีที่แล้ว +1

    Great video as usual, thanks!
    Any reason you're using event handlers over actions? For the named args? Habit?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +1

      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.

  • @xenithmusic3029
    @xenithmusic3029 4 ปีที่แล้ว +1

    Gg on 100k

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      Thanks! Glad people like the videos!

  • @DrunkCepums211
    @DrunkCepums211 4 ปีที่แล้ว

    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.

  • @user-yh8hh9cy3k
    @user-yh8hh9cy3k 4 ปีที่แล้ว

    Thank you for the video!

  • @Andrew90046zero
    @Andrew90046zero 4 ปีที่แล้ว

    a genius and a madd ladd

  • @poresrage5053
    @poresrage5053 3 ปีที่แล้ว

    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

  • @alannguyen4636
    @alannguyen4636 2 ปีที่แล้ว

    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.

    • @alannguyen4636
      @alannguyen4636 2 ปีที่แล้ว

      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

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ปีที่แล้ว +1

      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

  • @Neon_Byte_
    @Neon_Byte_ ปีที่แล้ว

    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?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      It depends on the size of the texture and the pixels per unit in the texture import settings

  • @admink8662
    @admink8662 ปีที่แล้ว

    Nice

  • @killereks
    @killereks 4 ปีที่แล้ว +1

    4:50 line 47 is redundant, just return false there instead of the else

    • @maarten1012TTT
      @maarten1012TTT 4 ปีที่แล้ว

      He probably knows that already 😂

    • @killereks
      @killereks 4 ปีที่แล้ว

      @@maarten1012TTT yep but it always bothers me when people do
      if true
      return true
      else
      return false

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +2

      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.

    • @killereks
      @killereks 4 ปีที่แล้ว

      @@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

  • @gavenhollenbeck4630
    @gavenhollenbeck4630 2 ปีที่แล้ว +1

    how are you dragging items

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ปีที่แล้ว

      I covered drag drop here th-cam.com/video/BGr-7GZJNXg/w-d-xo.html

  • @scart3redup304
    @scart3redup304 4 ปีที่แล้ว

    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?

    • @Pookzob
      @Pookzob 4 ปีที่แล้ว

      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.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +1

      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

  • @soldierx-1925
    @soldierx-1925 3 ปีที่แล้ว

    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.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      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

  • @griffinbrooks6748
    @griffinbrooks6748 2 ปีที่แล้ว

    now can you make furnace?

  • @KonradGM
    @KonradGM 2 ปีที่แล้ว

    any reason for leaving ',' in arrays?

  • @nashiruddin3543
    @nashiruddin3543 4 ปีที่แล้ว +1

    Plz a video on chest inventory

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      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

  • @BelladonGameDeverUA
    @BelladonGameDeverUA 4 ปีที่แล้ว +1

    It seems easy with you.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      That's what you get with 20 years of Programming and 10 years of Game Development!
      Keep at it! Experience is key!

  • @mustafacinoglu3606
    @mustafacinoglu3606 4 ปีที่แล้ว

    How can i make that 360 sword attack

  • @rentox3969
    @rentox3969 4 ปีที่แล้ว

    In which video you created the UI_Item class?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +1

      In the Inventory System th-cam.com/video/2WnAOV7nHW0/w-d-xo.html

  • @josevalenzuela4540
    @josevalenzuela4540 4 ปีที่แล้ว

    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 :(

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      What compiling errors? The project files contain the fully working final state of the video.

    • @josevalenzuela4540
      @josevalenzuela4540 4 ปีที่แล้ว

      @@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?)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      @@josevalenzuela4540 You need to install the Lightweight RP in the Package Manager

  • @skeletony7515
    @skeletony7515 4 ปีที่แล้ว

    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

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      You can use the auto translate which should work most of the time

  • @arthurmorgan923
    @arthurmorgan923 4 ปีที่แล้ว

    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.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      Just about anything can run Unity so yes those specs will work just fine.

    • @arthurmorgan923
      @arthurmorgan923 4 ปีที่แล้ว

      @@CodeMonkeyUnity do you use laptop which one

  • @CharmFlex
    @CharmFlex 4 ปีที่แล้ว

    Is it possible for a beginner to understand the code?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      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.

  • @artistaartificial5635
    @artistaartificial5635 4 ปีที่แล้ว

    What is the list of videos to get here?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      There's links in the description, the main one being the Inventory System th-cam.com/video/2WnAOV7nHW0/w-d-xo.html

  • @xenithmusic3029
    @xenithmusic3029 4 ปีที่แล้ว

    Yayyy... you forgot about planks.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว

      Heh yeah I know I wanted to simplify it for the video and it made more sense to start with Wood rather than Planks

  • @ard9028
    @ard9028 4 ปีที่แล้ว

    how can i learn java to make games

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +1

      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++

    • @ard9028
      @ard9028 4 ปีที่แล้ว

      @@CodeMonkeyUnity thx

    • @mr.fakeman4718
      @mr.fakeman4718 4 ปีที่แล้ว

      if (fan_of_JMonkey) { Learn("Java"); } else Learn("C#" || "C++);

  • @DoraTheExplorerrr
    @DoraTheExplorerrr 4 ปีที่แล้ว

    i cant download the UTILS

  • @user-ss1ql8tg6b
    @user-ss1ql8tg6b 4 ปีที่แล้ว

    Usual video 60 - 130 likes, video about minecraft - 250................................

  • @adam120yep5
    @adam120yep5 4 ปีที่แล้ว

    someone created a mess on ur server

  • @GrossikMods
    @GrossikMods 3 ปีที่แล้ว

    No, this is not Minecraft style crafting

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      Why not? What's missing? I expanded upon the recipe system here th-cam.com/video/E91NYvDqsy8/w-d-xo.html

  • @TurkiShGamers-hs1kw
    @TurkiShGamers-hs1kw 4 ปีที่แล้ว

    you should make course from udemy

  • @a.labyad1473
    @a.labyad1473 4 ปีที่แล้ว

    Your know how to make a 3d game 🤔🧠

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 ปีที่แล้ว +1

      Most of the videos I make are independent of dimension, you can use this system in either 2D or 3D