Create an easy craft system
Hello,
I would like to add a simple craft system (3 Wood = House) in my multiplayer game, have you a script or a idea how i can collect wood and craft a house (I have already a house prefab) in my game? I'm french, sorry for the grammar mistakes =).
Thank you.
BazooClem
2D or 3D? Easy crafting? At first try to collect stuff, and drop stuff, i made a vid tutorial about such stuff in 3d for some kind of survival game. Nothing fancing but a point to start.
https://www.youtube.com/watch?v=BLH34k8mSSY
Once you have that you can fiddle around with crafting.
Answer by Statement · Nov 09, 2015 at 06:24 PM
Create a crafting system similar to the solution to this question.
Then you can define stuff like:
// Set up crafting rules (1 House = 3 Wood)
database
.Create("House")
.Require("Wood", 3);
// populate inventory (Start with 3 Wood)
inventory.SetAmount("Wood", 3);
// Craft House. Inventory will now contain 1 House and 0 Wood. (added House, removed Wood)
database.Craft("House", inventory);
The classes has functions to see what you can craft based on your inventory. After you've created the House, you can remove it from your inventory and spawn the house.
The name "database" may be a little misleading. It's not a database like SQL etc. It's just a bunch of recepies. It could just as well be called recepies to make it clearer but I chose to stick with my example na$$anonymous$$g for consistency in this answer.
Your answer
![](https://koobas.hobune.stream/wayback/20220612044506im_/https://answers.unity.com/themes/thub/images/avi.jpg)