Simple Shop! Easily add more Items/Weapons/Skills to buy and with the ICustomer interface you can easily apply it to your own games! 🎮 Play 7 Awesome Games (Action, Strategy, Management) and Help Support the Channel! ✅ Get the Game Bundle 67% off unitycodemonkey.com/gameBundle.php
Thank you so much @Code Monkey, it took me 3 times watching this video to actually understand the logic, pretty new to Unity, event and interface still hard to understand recently hahaha..
I have a whole bunch of Playlists that group videos on various topics, however each element is usually pretty standalone so don't have a straight guided path other than the Basics playlist. I would like to one day do a complete course going from beginner to advanced.
Excellent content, thanks! But do you have a new video of this with best practices? like using Scriptable objects to create the items instead of the GameAssets class, and not using the 'Find' keyword and getting the references by 'GetComponent' or similar, anchoring the items using content sized fitter and Horizontal/Vertical Layout group? Thanks for the excellent content again 😁
Yeah I've been wanting to make an updated video related to inventory/shop/crafting but haven't been able to do it yet, I did do some of it in the last video where I used items unitycodemonkey.com/video.php?v=_aC3NVIQ-ok
@@CodeMonkeyUnity That's awesoe! Thanks for the link, I will watch it and see how I can implement it in my game (I am creating a Dynamic and responsive shop system)
Can you point me in a direction on how to make it so after I buy, lets say Armor 1, I dont want to be able to buy it again and after I buy Armor2 I want to instead of buying armor1 again, change it to a "equip" button instead.
Could be as simple as storing an int for your moneyAmount that you increase when the enemy dies. If you're asking about persisting data through scenes then one simple way is using a static field
@@CodeMonkeyUnity Do you have any video on how to do it or can I look for any coin counter tutorial and have it give me money when I kill an enemy and then do your store tutorial. Would it still work?
It sounds like you should really focus on learning the basics first, I recommend you go through my free 10 hour course th-cam.com/video/AmGSEH7QcDg/w-d-xo.html You won't find tutorials that are 100% exactly what you're trying to build, you learn the core concepts and then apply it to your specific scenario.
For people that are already experienced this is helpful for sure, but you don't explain enough for beginners and even some intermediates like me. You usually say what you are doing but not exactly how you are doing it (what exactly the methods etc do), maybe you can try doing that just a little more often. Also, the speed-up sounds are a little discomforting >w< xd
@@CodeMonkeyUnity It's your overall style of explanation. For example in the very first lines of code, you are telling the viewer what these lines do (grabbing a reference). However, when you haven't worked with the methods before (for example what Tags are or how to access them) you already won't be able to follow anymore. When, as a beginner/intermediate, you simply copy paste the lines it'll be a lot harder to learn what how they really work, since from this video you'd only know their outcome. I hope you get what I'm saying ':D I appreciate the video anyway, helps out a lot. :)
Hey code monkey, Amazing videos as always, although im stuck in a weird spot with this video. At 6:15, when i try to run the script to test the items are in place, they all appear hidden, and overlap each other when re-activated. The function works in that the sprites and the text are all different, but they overlap and start hidden and i cannot seem to find why. Thank you in advance!
Did you add a different positionIndex for each function call? On the CreateItemButton() are you correctly setting the anchoredPosition based on the index and a height amount? Or maybe you just have the template visible
@@CodeMonkeyUnity Thank you for the response, I was able to fix the problem but i am now running into a new issue where "shopCustomer.BoughtItem(itemType);" in void trybuyitem() somehow gives a nullreference. Maybe im misunderstanding how interfaces work but I shouldnt be getting a nullreference for an interface right? EDIT: figured it out, you have to start the shop with the show() function and reference the ishopcustomer in player as the instance
Hello, great tutorial but i really dont understand how you are showing the different items on scream when on the awake you setActive to false and dont change it or do anything to show it afterwards. I made avery thing you did and the code works because if y setActive to true it shwos my item with the correct information but in the wrong possition. But if I just leave it la you have it, it will simply not show up. (6:12)
I have a question my friends and I have designed what we want our shop to look like but we don't know how to program it so the buttons work. This greatly helps in further understanding what we are trying to do but how would we implement our design?
can you make a video on buying coins through IAP(in app purchases) and the buying skins then equipping it and using in the game and it saves the process
Good question, the main thing is instead of doing Enums to identify item types I would nowadays use Scriptable Objects unitycodemonkey.com/video.php?v=7jxS8HIny3Q Nowadays I also no longer use Find(); in my code, I use SerializeField direct references
@CodeMonkeyUnity Yea, i suspected that you would use scriptable objects instead and I noticed in your turn based course that you preferred to use a serializefield instead. Would be nice if you some time in the future would redo thise old system tutorials but using the new features of unity and modern code. Maybe in 3d just to make them different.
Hi @CodeMonkey its me again! I have a question about the shader graph. For example, after i have created the material with the shader and i gave this material to 2 gameObjects, i cant choose the color individually through the material for each game object (naturally). Is there a way to give to each gameObject a diferent color through the same Material & shader? I suppose we can through a script. Just want to know how would you do it. Thanks for the videos!! I would recommend to make a video about the persistence of a game object (player for example) between different scenes. (There is not much info about that on youtube and you could get more views or about post processing in 2D & 3D. Good luck friend!
For 2 game objects to have 2 different colors they need 2 different materials. Why do you want them to have different colors but same material? The only way to do that is to play around with MaterialPropertyBlock which is likely very unnecessary.
1) Its REALLY not that hard to do UI, I consider myself to be new to unity, just watch Brackeys 2) If you really want to u can slow down the playback speed
Congratulations for the video! When I get to the test you do at minute 6:34 it gives me the following error "ArgumentException: The Object you want to instantiate is null" How can I fix it? Thank you so much :)
You're calling Instantiate on the shopItemTemplate which is grabbed through a Find(); make sure the name is exactly the same. Add some Debug.Log(); to find out if something else is null
I don't really know, I think it's hard code, becasuse what if you have 100 items in your game? Would you write line of code for each item? I think it's possible to make it work with for loop and it will save your time and make your code better and clean
The shop can be used on any scene, just copy paste the UI into your Main Menu scene. For Saving and Loading check out these videos th-cam.com/play/PLzDRvYVwl53vRrMuPBkNNZUmnl1jCHcHs.html
You mainly just need to add the package, that's what I do for my base scene, it already has all the packages from previous videos so I can easily use them.
set the player to not Active when u hit the trigger, this will make him disappear (depending on what part you deactivated) but i only code for 3d so...
The default case is what happens if no other case matches the switch variable. If the default does not have a break then it will run the same code as the following case.
i have few questions if you dont mind: 1.could you share what's in the "get code amount" function? i checked several videos and i can't find where you making it. 2.When i enter a trigger shop it works(debug.log"entered") ,BUT it doesn't appear . Altho if i comment this line of code "shopItemTemplate.gameObject.SetActive(false)" at the Awake func. Otherwise it doesn't appear , have you experienced the same?
You mean GetGoldAmount() ? It just returns an int that stores the gold amount. Pause the game when you enter the shop, the Template should be inactive but all others should be active.
How could I "stop" my game when the shop is opened? You can destroy objects with clicks in my game, I don't want it when the shop is opened. Any tips ?
Bro right on time, im looking for youtube videos that are short... edit: can i equip stuff and unequip?, btw i dont see the sprites, and images, my shopItemTemplate is off the whole time.
Firs it is awesome tut. I have a question. I am preparing a hyper-casual game but I need to add a simple shop system in my game, in the game player will collect coins and can buy some skins my problem start here how can I change the skin of the player. The first thing I think is editing a Mesh Renderer component. Is there a better way to solve my problem. For example, my player game object is cube at the beginning but if the user collects 100 coins they can buy traffic cone or car for example.
Bolt works through C# Reflection so it can do anything that C# can do, if you choose Programmer Naming the nodes are all named exactly like their C# counterparts.
qestion! any idea how i can do with power ups instead like extra speed, damage, more hp, or little turrets that spawn how many depending on how much you buy it
great tut! But I need a system that includes a confirmation pop up. Like an "are you sure you want to buy X for $X?" pop up. Only way I can think of doing it is hard coded changing the text using different ints for each item. Does anybody know if that way is bad to do or if it is acceptable? cant seem to find tuts about niche things like this but I guess it's because once you get to a certain level you should be able to use what you know to do those things... im just such a mediocre coder :(
just go onto the button and when its clicked (this literally requires 0 code) then activate a pop up that says are u sure, then if u click yes it will buy and if u click no it will de activate the pop up. simple
@@alfredothemuscleking well it wouldn't be that simple because the "yes" button does many different things depending on the scenario. I've since figured it out using ints btw. Thanks for the suggestion though
@@CodeMonkeyUnity I have already attached the 'UIShop.cs' script to the game object's component. For the syntax I used on the ShopTriggerArea game object : [SerializeField] private UIShop uiShop; But I still can't drag and drop the UIShop game object into the ShopTriggerArea game object. can you help me?
That's the only possible reason. MaAybe you're dragging the child game object instead of the main game object that has that component. Or maybe somehow you defined multiple scripts with the exact same Class name, but I have no idea how you could have done that accidentally.
i want a shop that sells to players but it also buys items from players when they bring items they have, or they found or looted. i want the shop to pay 50% of the original price. i would like to manually adjust in an admin panel somewhere while the game is live, to changet he % that the shop pays per items in the game, so that some items it pays 0% (does not buy it from characters) but some items can be sold for 50% to the store, others the store pays 10% or 100% and so on. how much would you charge me to implement that in my unity game?
Hi there! Seems like I have a problem with the ClickFunc function which does not appear on the VS intellicode and gives me syntax errors. I am using the default Unity button component on my shopItemTemplate gameobject. Any help will be appreciated. Thanks :)
In the video I use my Button component that is included in my utilities. If you're using the standard Unity Button then you can add a listener to the OnClick event.
@@CodeMonkeyUnity yeah, I tried adding a AddListener component to the OnClick function and then when I try to do the TryBuyItem( itemtype), some wierd errors are thrown by unity and after doing some research, I came to see that we can have no parameters in the AddListener component. Please help me if you know any solution to this problem. Also I tried making the TryBuyItem a public void so that I could use it in the OnClick events section on the button, but the function simply does not appear there inspite of being a public void. It would be so kind of you if you could give me a solution to this. Thanks.
Nothing, this is a standalone video. There are some referenced videos in the description on some of the elements used, also this character controller th-cam.com/video/Bf_5qIt9Gr8/w-d-xo.html
Could be as simple as spawning the gold prefab when the enemy dies, perhaps on an event on their Health System unitycodemonkey.com/video.php?v=tf8NhUgORQg Then listen to a collision with the gold object to pick it up unitycodemonkey.com/video.php?v=Bc9lmHjqLZc
@@CodeMonkeyUnity its not your problem I Did not want sprites but I'm guessing I need them I get a lot of errors. but its fine and what a legend you are replying to a almost year old vid.
Hey CM! I noticed that you used Item.GetSprite and Item.GetCost and all that stuff, but when I try using Item it doesnt work. Is this smth you made earlier and are currently using? or what's up with it
How do I properly load the project files? I tried creating a new project with Shop.unitypackage, but when I open the shop scene a lot scripts, materials, etc. weren't able to load into the objects.
Seems UnityEngine.Experimental.Rendering.LWRP isn't supported anymore, so that was causing some errors when loading the project files. After commenting out the lines, the game runs. There are still unset materials and textures so the player and shop will just be pink blobs, but otherwise, It'll work fine to understand the logic and scripts.
Hi, I'm wondering if there's another way to equip the items without using switch statements, I saw that you used an interface to avoid dependency in your code so I think that the items could inherit from an abstract class called Item and three classes inherit from Item: Weapon, Armor, Potions. Also the Item class could be a ScriptableObject. In that way the items would store all the data they need. Make a few if statements instead of the Switch statement is something that comes to my mind but again I'm not sure so that's why I ask.
Sure that is a valid approach. Personally I do not like inheritance at all and find that it just ends up making my code really messy. So I normally use a enum type rather than different classes to define types of thing like Items/Enemies/Skills, etc. ScriptableObjects are excellent for making your game more designer friendly, I normally work alone so that's why I do as much through code as I can.
Hi codemonkey I have been working on my first game, and I want to add a knockback mechanic, however there are few videos on how to do knockback, and those didn't work for my game. I think a video on how to do knockback would be interesting. Keep it up.
Knockback is usually just moving the transform or the rigidbody backwards, so something like transform.position += (playerPosition - attackerPosition).normalized * knockbackDistance;
So that the video doesn't end up being 2 hours long and buried by the TH-cam algorithm. You can always either pause the video or download the complete project files.
Nice video but you were going WAY TOO FAST like whoah there ALSO its very annoying to have to open a hundred videos just to see the things you did in previous videos to be able to do the things in this video.
You can pause the video at any time, you're not expected to build the whole system during the normal duration of the video just like I didn't make the video in that time. I do research, then I try it out, then I write the video, record, edit and come up with the final duration. Keeping systems separate is just good practice, you should compose your bigger systems made up of other separate systems instead of having everything tightly coupled.
I didn't stop, I'm always making new videos, only made fewer last month because I was busy working on my latest course th-cam.com/video/Hd6K7mfXt08/w-d-xo.html
hey so when i run the create button function it first creates the default template ,doesnt matter what name,cost icon i put into it, any clues on what the fuck is happening? tried everything i could think of,the second one and later are off by one(if i have weapons 1-3, and instantiate 5 in order of (3,2,1,2,3) it goes (clone of template,3,2,1,2)
Add some Debug.Log(); to see what your code is doing at various stages, sounds like you might be making a couple of extra copies and losing their reference
@@CodeMonkeyUnity alright got it working ,wasnt a missing reference but the way i made it, i was instantiateing it from a prefab then changeing the prefab, changed it up a bit now it works fine, thx for the help anyway
Code monkey I appreciate your work please and please their lots of videos on making multiplayer lobby, in game inventory and shop system. But if you try to search for shop system for multiplayer in start menu there's non like I don't want to make RPG I just wanna make a game where my players are able to buy characters (cars) and enter game with that character (car) but I don't how to please make a tutorial about it I'm making a multiplayer car race game I want players to buy cars and equip it then enter game with it, please
You can just use a ServerRPC to tell the server which character that player selected, just send back a simple enum ClientSelectedCharacterServerRPC(Character.Wizard); that's it.
@@KBforJesusChrist If you are a complete beginner then you should really start with the basics first, multiplayer is quite a bit more complex unitycodemonkey.com/video.php?v=E6A4WvsDeLE unitycodemonkey.com/video.php?v=IFayQioG71A
@@CodeMonkeyUnity i know the basics I'm watching allot of photon or netcode tutorials and I think I'll handle the creating multiplayer part but I don't know how to add the shops please make a tutorial th-cam.com/video/k23kUwYhZe8/w-d-xo.html Like this one please would you help me I'll appreciate it
The shop should be completely separate from whatever game logic you have, this set up will work whether your game is a 3D action game or a 2D platformer. The shop shouldn't depend on the specifics of your game
I have found good stuff and tutorials in you're channel that i think nobody have done with it, I had watched you're 70% videos but Its difficult to understand what the code you are typing because you're speeding up that part and explaining after writing almost in every videos, the begginers could not be understand this!😥😥 it should be wonderfull if you explain while typing so we will underatand it better!!😊😊And i very appriciate that you're answering us, and helping us!!!
99% of this tutorial is "I covered this in a separete video". Okay can we not check 45 videos and just make a shop system? Also code is so sped up I can't even see what's happening on 0.25x speed
That's how game development works, you build systems on top of systems. If you're looking for a step-by-step guide from nothing until a complete game then it sounds like you'd be better off following a complete course instead of separate tutorials th-cam.com/video/PcArjIC1QnQ/w-d-xo.html
Thanks for answering, I already made the life bar but how do I get money from killing them so I can save that money to later make the purchase store?@@CodeMonkeyUnity
@@CodeMonkeyUnity Thanks for answering, I already made the life bar but how do I get money from killing them so I can save that money to later make the purchase store?
Simple Shop! Easily add more Items/Weapons/Skills to buy and with the ICustomer interface you can easily apply it to your own games!
🎮 Play 7 Awesome Games (Action, Strategy, Management) and Help Support the Channel!
✅ Get the Game Bundle 67% off unitycodemonkey.com/gameBundle.php
Nice work ! Keep upload videos ✓✓ I love your work .
Man thinks....you are the best
Stupid question but can you also add entities? Think of a Pokemon kind of game so you can buy/sell monsters.
auction shop works same way?
Honestly the most underrated coder in youtube... please keep uploading... Love you man!!
Thanks!
Thank you so much @Code Monkey, it took me 3 times watching this video to actually understand the logic, pretty new to Unity, event and interface still hard to understand recently hahaha..
As long as you know more today than you did yesterday then you're doing great! Keep it up!
Great video! I always speed these types of tutorials up, but after a while you started sounding like Kermit the frog, LOL!
LMAO I HEAR IT
such an over the top death animation haha :P sooo much blood!
Uhhh I love that !
Thanks :)
And have great days ! :)
Fico impressionado com a quantidade de conteúdo você tem. Qualquer dúvida que tenho, sempre vai ter um video seu a respeito 😆
Obrigado! Fico contente que os meus videos te tenham ajudado!
I just wanted to make something like this, thank you so much
I'm glad the video helped you!
Definitely going to try this with something, very cool stuff again.
Thanks for these lessons.
Code monkey is awesome :) I would recommend this channel to anyone making a game in Unity. :)
Love the layout of the video. Here is what we are going to do. Now ill show you how. Lets me know very early this is the video for me.
Amazing .. please can you try to sort it out in a playlist for absolutely beginners from intro screen and so on .. great job 👍
I have a whole bunch of Playlists that group videos on various topics, however each element is usually pretty standalone so don't have a straight guided path other than the Basics playlist.
I would like to one day do a complete course going from beginner to advanced.
Awesome viedo👌👌👌👌 You are Forever Great Teacher for me🙏🙏🙏🙏🙏🙏🙏🙏
You will soon cross the milestone of 100k !
Almost there!
If you had for example 20 items in your shop, how would you make it so that the player can scroll up and down on the list of displayed elements?
Excellent content, thanks! But do you have a new video of this with best practices? like using Scriptable objects to create the items instead of the GameAssets class, and not using the 'Find' keyword and getting the references by 'GetComponent' or similar, anchoring the items using content sized fitter and Horizontal/Vertical Layout group?
Thanks for the excellent content again 😁
Yeah I've been wanting to make an updated video related to inventory/shop/crafting but haven't been able to do it yet, I did do some of it in the last video where I used items unitycodemonkey.com/video.php?v=_aC3NVIQ-ok
@@CodeMonkeyUnity That's awesoe! Thanks for the link, I will watch it and see how I can implement it in my game (I am creating a Dynamic and responsive shop system)
Can you point me in a direction on how to make it so after I buy, lets say Armor 1, I dont want to be able to buy it again and after I buy Armor2 I want to instead of buying armor1 again, change it to a "equip" button instead.
Whenever I search for solution I find you
I'm glad my videos have helped you!
Thanks for the great video! Question, how did you make the player HUD? Do you have a tutorial for it?
Thanks for answering, I already made the life bar but how do I get money from killing them so I can save that money to later make the purchase store?
Could be as simple as storing an int for your moneyAmount that you increase when the enemy dies. If you're asking about persisting data through scenes then one simple way is using a static field
@@CodeMonkeyUnity Do you have any video on how to do it or can I look for any coin counter tutorial and have it give me money when I kill an enemy and then do your store tutorial. Would it still work?
It sounds like you should really focus on learning the basics first, I recommend you go through my free 10 hour course th-cam.com/video/AmGSEH7QcDg/w-d-xo.html
You won't find tutorials that are 100% exactly what you're trying to build, you learn the core concepts and then apply it to your specific scenario.
Which previous video? Where @Code Monkey created the game assets and item script mentioned in this video.
Theres links in the description
Did you find the video?
For people that are already experienced this is helpful for sure, but you don't explain enough for beginners and even some intermediates like me. You usually say what you are doing but not exactly how you are doing it (what exactly the methods etc do), maybe you can try doing that just a little more often.
Also, the speed-up sounds are a little discomforting >w< xd
What part did you find was not well explained?
@@CodeMonkeyUnity It's your overall style of explanation. For example in the very first lines of code, you are telling the viewer what these lines do (grabbing a reference). However, when you haven't worked with the methods before (for example what Tags are or how to access them) you already won't be able to follow anymore. When, as a beginner/intermediate, you simply copy paste the lines it'll be a lot harder to learn what how they really work, since from this video you'd only know their outcome.
I hope you get what I'm saying ':D
I appreciate the video anyway, helps out a lot. :)
Hey code monkey, Amazing videos as always, although im stuck in a weird spot with this video. At 6:15, when i try to run the script to test the items are in place, they all appear hidden, and overlap each other when re-activated. The function works in that the sprites and the text are all different, but they overlap and start hidden and i cannot seem to find why. Thank you in advance!
Did you add a different positionIndex for each function call?
On the CreateItemButton() are you correctly setting the anchoredPosition based on the index and a height amount?
Or maybe you just have the template visible
@@CodeMonkeyUnity Thank you for the response, I was able to fix the problem but i am now running into a new issue where "shopCustomer.BoughtItem(itemType);" in void trybuyitem() somehow gives a nullreference. Maybe im misunderstanding how interfaces work but I shouldnt be getting a nullreference for an interface right?
EDIT: figured it out, you have to start the shop with the show() function and reference the ishopcustomer in player as the instance
Hello, great tutorial but i really dont understand how you are showing the different items on scream when on the awake you setActive to false and dont change it or do anything to show it afterwards. I made avery thing you did and the code works because if y setActive to true it shwos my item with the correct information but in the wrong possition. But if I just leave it la you have it, it will simply not show up. (6:12)
I have a question my friends and I have designed what we want our shop to look like but we don't know how to program it so the buttons work. This greatly helps in further understanding what we are trying to do but how would we implement our design?
awesome
Great work ♥️👍
Thank you this wil surely be useful! :)
can you make a video on buying coins through IAP(in app purchases) and the buying skins then equipping it and using in the game and it saves the process
Great tutorial.
Would you implement this in a different way if you would redo it?
Good question, the main thing is instead of doing Enums to identify item types I would nowadays use Scriptable Objects unitycodemonkey.com/video.php?v=7jxS8HIny3Q
Nowadays I also no longer use Find(); in my code, I use SerializeField direct references
@CodeMonkeyUnity Yea, i suspected that you would use scriptable objects instead and I noticed in your turn based course that you preferred to use a serializefield instead.
Would be nice if you some time in the future would redo thise old system tutorials but using the new features of unity and modern code.
Maybe in 3d just to make them different.
Nice ! Thats what im looking for .. bro how easy would it be to add inapp purchases to buy coins in this Script? Thank u
Unity Gaming Services has a tool for IAP so maybe look into that one unitycodemonkey.com/video.php?v=JwClCc2_zC8
Hi @CodeMonkey its me again! I have a question about the shader graph. For example, after i have created the material with the shader and i gave this material to 2 gameObjects, i cant choose the color individually through the material for each game object (naturally). Is there a way to give to each gameObject a diferent color through the same Material & shader? I suppose we can through a script. Just want to know how would you do it. Thanks for the videos!! I would recommend to make a video about the persistence of a game object (player for example) between different scenes. (There is not much info about that on youtube and you could get more views or about post processing in 2D & 3D. Good luck friend!
For 2 game objects to have 2 different colors they need 2 different materials. Why do you want them to have different colors but same material? The only way to do that is to play around with MaterialPropertyBlock which is likely very unnecessary.
Why did you fast forward on the part you "just built it up" , am I supposed to just know how to do that?
just add the shop UI
He's one of the worst teachers in code, don't recommend his videos at all.
@@turoreal Brackeys is a legend.
1) Its REALLY not that hard to do UI, I consider myself to be new to unity, just watch Brackeys
2) If you really want to u can slow down the playback speed
@@turoreal skill issue💀
Congratulations for the video! When I get to the test you do at minute 6:34 it gives me the following error "ArgumentException: The Object you want to instantiate is null" How can I fix it? Thank you so much :)
You're calling Instantiate on the shopItemTemplate which is grabbed through a Find(); make sure the name is exactly the same.
Add some Debug.Log(); to find out if something else is null
I don't really know, I think it's hard code, becasuse what if you have 100 items in your game? Would you write line of code for each item? I think it's possible to make it work with for loop and it will save your time and make your code better and clean
Plz one more video on how to make a shop on main menue and how to save collected coins from game there
The shop can be used on any scene, just copy paste the UI into your Main Menu scene.
For Saving and Loading check out these videos th-cam.com/play/PLzDRvYVwl53vRrMuPBkNNZUmnl1jCHcHs.html
Tnx I will💓
Would love to see shop that sells things for real money
Hello Code monkey excellent tutorial. Can you explain how this shop can be setup to work woith Corgi engine? That would be greate to be honest.
One idea can be Everytime adding stuff to a project you have already built in a previous video. In order to show us how can a Game can be upgraded
You mainly just need to add the package, that's what I do for my base scene, it already has all the packages from previous videos so I can easily use them.
How is it possible to make him stop attacking when clicking a button?
set the player to not Active when u hit the trigger, this will make him disappear (depending on what part you deactivated) but i only code for 3d so...
Can someone answer me? Why is the default state of the switch on the top, and with no parameters?
The default case is what happens if no other case matches the switch variable.
If the default does not have a break then it will run the same code as the following case.
i have few questions if you dont mind:
1.could you share what's in the "get code amount" function? i checked several videos and i can't find where you making it.
2.When i enter a trigger shop it works(debug.log"entered") ,BUT it doesn't appear . Altho if i comment this line of code "shopItemTemplate.gameObject.SetActive(false)" at the Awake func. Otherwise it doesn't appear , have you experienced the same?
You mean GetGoldAmount() ? It just returns an int that stores the gold amount.
Pause the game when you enter the shop, the Template should be inactive but all others should be active.
@@CodeMonkeyUnity thank you for quick answer
I'm keep spending gold even if I have the item. How could i fix that?
Seems like it's not important
How could I "stop" my game when the shop is opened? You can destroy objects with clicks in my game, I don't want it when the shop is opened. Any tips ?
You can use a Image in the UI that is behind the Shop and blocks all clicks
@@CodeMonkeyUnity Thanks for the answer, going to try it 🤩
Bro right on time, im looking for youtube videos that are short... edit: can i equip stuff and unequip?, btw i dont see the sprites, and images, my shopItemTemplate is off the whole time.
If u buy something and destroy it.
When u leave the shop and come back again, u will see the same item in the shop.
How to prevent that?
Firs it is awesome tut. I have a question.
I am preparing a hyper-casual game but I need to add a simple shop system in my game, in the game player will collect coins and can buy some skins my problem start here how can I change the skin of the player. The first thing I think is editing a Mesh Renderer component. Is there a better way to solve my problem. For example, my player game object is cube at the beginning but if the user collects 100 coins they can buy traffic cone or car for example.
You're describing changing the Mesh and not just the Visual so you would change the MeshFilter instead
@@CodeMonkeyUnity Than you.
Hey Code Monkey! Amazing video. I just had some problems trying to sign up to your website...
Hi code monkey I wanted to ask that does it work with ur visual scripting course?
Bolt works through C# Reflection so it can do anything that C# can do, if you choose Programmer Naming the nodes are all named exactly like their C# counterparts.
@@CodeMonkeyUnity Okay Thanks ! I recently bought ur visual scripting course. Its very niceee.
qestion! any idea how i can do with power ups instead like extra speed, damage, more hp, or little turrets that spawn how many depending on how much you buy it
It can be as simple as a "float speed" on your player and when you buy a speed upgrade you increase that value
it dosn't get a callout but at 6:20 he adds x.gameObject.SetActive(true); in the createitembutton
correct, its added at 6:22
great tut! But I need a system that includes a confirmation pop up. Like an "are you sure you want to buy X for $X?" pop up. Only way I can think of doing it is hard coded changing the text using different ints for each item. Does anybody know if that way is bad to do or if it is acceptable? cant seem to find tuts about niche things like this but I guess it's because once you get to a certain level you should be able to use what you know to do those things... im just such a mediocre coder :(
just go onto the button and when its clicked (this literally requires 0 code) then activate a pop up that says are u sure, then if u click yes it will buy and if u click no it will de activate the pop up. simple
@@alfredothemuscleking well it wouldn't be that simple because the "yes" button does many different things depending on the scenario. I've since figured it out using ints btw. Thanks for the suggestion though
i love video. thanks bro!!!
Why can't I drag and drop the UIShop game object into the serialized field ShopTriggerArea?
Because whatever object you're dragging does not have the component of the field you're dragging it onto
@@CodeMonkeyUnity I have already attached the 'UIShop.cs' script to the game object's component. For the syntax I used on the ShopTriggerArea game object : [SerializeField] private UIShop uiShop;
But I still can't drag and drop the UIShop game object into the ShopTriggerArea game object. can you help me?
That's the only possible reason. MaAybe you're dragging the child game object instead of the main game object that has that component.
Or maybe somehow you defined multiple scripts with the exact same Class name, but I have no idea how you could have done that accidentally.
Can the cs you use be used in 3D TPS?
i want a shop that sells to players but it also buys items from players when they bring items they have, or they found or looted. i want the shop to pay 50% of the original price. i would like to manually adjust in an admin panel somewhere while the game is live, to changet he % that the shop pays per items in the game, so that some items it pays 0% (does not buy it from characters) but some items can be sold for 50% to the store, others the store pays 10% or 100% and so on.
how much would you charge me to implement that in my unity game?
Can you please do a video where the shop is in a separate scene
Did you find any solutions ? I'm probably having the same issue :/
Please HELP I keep getting an error saying that something is null when I duplicate the button but I tested everything and they all came out not null
Use Debug.Log to find what is null unitycodemonkey.com/video.php?v=5irv30-bTJw
I need something like this for 2D space game but I need To know how to buy a new ship 🤗
Unfortunately for some reason an error pops up saying there's a null reference exception for the createitembutton, any ideas?
You have something set to null th-cam.com/video/5irv30-bTJw/w-d-xo.html
Hi there! Seems like I have a problem with the ClickFunc function which does not appear on the VS intellicode and gives me syntax errors. I am using the default Unity button component on my shopItemTemplate gameobject. Any help will be appreciated. Thanks :)
In the video I use my Button component that is included in my utilities.
If you're using the standard Unity Button then you can add a listener to the OnClick event.
@@CodeMonkeyUnity yeah, I tried adding a AddListener component to the OnClick function and then when I try to do the TryBuyItem( itemtype), some wierd errors are thrown by unity and after doing some research, I came to see that we can have no parameters in the AddListener component. Please help me if you know any solution to this problem. Also I tried making the TryBuyItem a public void so that I could use it in the OnClick events section on the button, but the function simply does not appear there inspite of being a public void. It would be so kind of you if you could give me a solution to this. Thanks.
What tutorial came before this?
Nothing, this is a standalone video. There are some referenced videos in the description on some of the elements used, also this character controller th-cam.com/video/Bf_5qIt9Gr8/w-d-xo.html
Code Monkey, maybe it’s a little late to comment but how do I make the enemies drop gold if they are prefabs
Also thanks for the shop system anyways 👍
Could be as simple as spawning the gold prefab when the enemy dies, perhaps on an event on their Health System unitycodemonkey.com/video.php?v=tf8NhUgORQg
Then listen to a collision with the gold object to pick it up unitycodemonkey.com/video.php?v=Bc9lmHjqLZc
I have been looking for the button_ui scrip for so long, where can I get or see the script ?
It's part of my utilities that you can download from my website, or you can just use the built in Unity Button, either one works
How enemy respawn and gets money after killing it? Do you have a tutorial for that?
I made a HealthSystem here unitycodemonkey.com/video.php?v=tf8NhUgORQg
You can hook onto the OnDead event and do whatever logic you want
Does this work on 3D games?
Sure, there's nothing about the Shop that is exclusive to 2D
Code Monkey thank you 🐒 🐵
Awesome~~ thanks~
Again, coding like playing a piano~~ cool~~
could you do a clouds tutorial unity (3d)
Watch this awesome video th-cam.com/video/Y7r5n5TsX_E/w-d-xo.html
thank you
I spent sooo long coding this and it doesn't even work :(
How does it not work?
@@CodeMonkeyUnity its not your problem I Did not want sprites but I'm guessing I need them I get a lot of errors. but its fine and what a legend you are replying to a almost year old vid.
what video does he talk about the game assists script at timestamp 4:20?
It's this one: th-cam.com/video/7GcEW6uwO8E/w-d-xo.html
Hey CM! I noticed that you used Item.GetSprite and Item.GetCost and all that stuff, but when I try using Item it doesnt work. Is this smth you made earlier and are currently using? or what's up with it
What doesn't work? Its just two normal functions
How do I properly load the project files? I tried creating a new project with Shop.unitypackage, but when I open the shop scene a lot scripts, materials, etc. weren't able to load into the objects.
Seems UnityEngine.Experimental.Rendering.LWRP isn't supported anymore, so that was causing some errors when loading the project files. After commenting out the lines, the game runs. There are still unset materials and textures so the player and shop will just be pink blobs, but otherwise, It'll work fine to understand the logic and scripts.
Hi, I'm wondering if there's another way to equip the items without using switch statements, I saw that you used an interface to avoid dependency in your code so I think that the items could inherit from an abstract class called Item and three classes inherit from Item: Weapon, Armor, Potions.
Also the Item class could be a ScriptableObject. In that way the items would store all the data they need.
Make a few if statements instead of the Switch statement is something that comes to my mind but again I'm not sure so that's why I ask.
Sure that is a valid approach. Personally I do not like inheritance at all and find that it just ends up making my code really messy.
So I normally use a enum type rather than different classes to define types of thing like Items/Enemies/Skills, etc.
ScriptableObjects are excellent for making your game more designer friendly, I normally work alone so that's why I do as much through code as I can.
Hi codemonkey I have been working on my first game, and I want to add a knockback mechanic, however there are few videos on how to do knockback, and those didn't work for my game. I think a video on how to do
knockback would be interesting. Keep it up.
Knockback is usually just moving the transform or the rigidbody backwards, so something like transform.position += (playerPosition - attackerPosition).normalized * knockbackDistance;
would you like to work on for my game?
it Keeps saying (Item) The Name Item doesn't exist in the current project!! Please help
Gonna need a little more info pal
in 3d the trigger doesnot works
what about 3d monkey??
Just swap the colliders for 3D colliders and the functions for the 3D Physics functions. OnTriggerEnter2D vs OnTriggerEnter
which unity version is this ? when I import it doesn't work
This was made in 2019.2.6
Dude...cool.
how to make a limit t upgrade an item
what is the gameassets script for? i need helpppppp
@CodeMonkeyUnity
It's just a way to easily access references through code unitycodemonkey.com/video.php?v=7GcEW6uwO8E
@@CodeMonkeyUnity thank youuuuuu
Why to fast forward while coding?
So that the video doesn't end up being 2 hours long and buried by the TH-cam algorithm.
You can always either pause the video or download the complete project files.
Can you please make user generated content
I've thought about it but that is heavily dependent on each specific game. Maybe I'll do one just loading a texture from a folder dynamically.
hello how can i make sell items in shop????
Depends on how you define items, could be with scriptable objects unitycodemonkey.com/video.php?v=E91NYvDqsy8
TH-cam says you have one view but you have 6 likes and 5 comments xD
TH-cam you drunk go home
Also, wow a minute after uploading ^^
You're faster than the stats!
Nice video but you were going WAY TOO FAST like whoah there ALSO its very annoying to have to open a hundred videos just to see the things you did in previous videos to be able to do the things in this video.
You can pause the video at any time, you're not expected to build the whole system during the normal duration of the video just like I didn't make the video in that time. I do research, then I try it out, then I write the video, record, edit and come up with the final duration.
Keeping systems separate is just good practice, you should compose your bigger systems made up of other separate systems instead of having everything tightly coupled.
why did you stop making videos make more unity tutorials man
I didn't stop, I'm always making new videos, only made fewer last month because I was busy working on my latest course th-cam.com/video/Hd6K7mfXt08/w-d-xo.html
@@CodeMonkeyUnity ok
hey so when i run the create button function it first creates the default template ,doesnt matter what name,cost icon i put into it, any clues on what the fuck is happening? tried everything i could think of,the second one and later are off by one(if i have weapons 1-3, and instantiate 5 in order of (3,2,1,2,3) it goes (clone of template,3,2,1,2)
also another thing i found out testing it is the name/price/icon of the item are correct it just spawns the exact clone of the template first
Add some Debug.Log(); to see what your code is doing at various stages, sounds like you might be making a couple of extra copies and losing their reference
@@CodeMonkeyUnity alright got it working ,wasnt a missing reference but the way i made it, i was instantiateing it from a prefab then changeing the prefab, changed it up a bit now it works fine, thx for the help anyway
how I can save shop state
Maybe make a save object to save what Items are available in the store and convert that to JSON th-cam.com/video/6uMFEM-napE/w-d-xo.html
I cannot access the website unitycodemonkey.com/. Is there a problem?
Seems someone attacked my website, I'm working to fix it
Code monkey I appreciate your work please and please their lots of videos on making multiplayer lobby, in game inventory and shop system.
But if you try to search for shop system for multiplayer in start menu there's non like I don't want to make RPG I just wanna make a game where my players are able to buy characters (cars) and enter game with that character (car) but I don't how to please make a tutorial about it I'm making a multiplayer car race game I want players to buy cars and equip it then enter game with it, please
You can just use a ServerRPC to tell the server which character that player selected, just send back a simple enum ClientSelectedCharacterServerRPC(Character.Wizard); that's it.
@@CodeMonkeyUnity I'm a beginner
@@KBforJesusChrist If you are a complete beginner then you should really start with the basics first, multiplayer is quite a bit more complex
unitycodemonkey.com/video.php?v=E6A4WvsDeLE
unitycodemonkey.com/video.php?v=IFayQioG71A
@@CodeMonkeyUnity i know the basics I'm watching allot of photon or netcode tutorials and I think I'll handle the creating multiplayer part but I don't know how to add the shops please make a tutorial
th-cam.com/video/k23kUwYhZe8/w-d-xo.html
Like this one please would you help me I'll appreciate it
Tu esi kroplis!!!1!
make same topic video for idle game 3d
sample of game: Outlesh Rush
The shop should be completely separate from whatever game logic you have, this set up will work whether your game is a 3D action game or a 2D platformer.
The shop shouldn't depend on the specifics of your game
is this working?
Yes, nothing here is limited to any specific Unity version
Nice...
The Game Assets Script wont work :( [Works]
What doesn't work? I covered it in detail here th-cam.com/video/7GcEW6uwO8E/w-d-xo.html
Thank you for Responding! I forgot a few words. My bad for taking youre time!
please speak shop equal cs-go, and use arms
4:12
Nice stuff but I didnt understand anything because hi is not explaing while writing the code and explaining after that!!!
Exactly what didn't you understand?
I have found good stuff and tutorials in you're channel that i think nobody have done with it, I had watched you're 70% videos but Its difficult to understand what the code you are typing because you're speeding up that part and explaining after writing almost in every videos, the begginers could not be understand this!😥😥 it should be wonderfull if you explain while typing so we will underatand it better!!😊😊And i very appriciate that you're answering us, and helping us!!!
99% of this tutorial is "I covered this in a separete video". Okay can we not check 45 videos and just make a shop system? Also code is so sped up I can't even see what's happening on 0.25x speed
That's how game development works, you build systems on top of systems.
If you're looking for a step-by-step guide from nothing until a complete game then it sounds like you'd be better off following a complete course instead of separate tutorials th-cam.com/video/PcArjIC1QnQ/w-d-xo.html
Where is the previous video where you made killing enemies give you money? help me please I'm going to subscribe
You can use whatever health system you want, like this one th-cam.com/video/tf8NhUgORQg/w-d-xo.html
Thanks for answering, I already made the life bar but how do I get money from killing them so I can save that money to later make the purchase store?@@CodeMonkeyUnity
Plis help me
@@CodeMonkeyUnity Thanks for answering, I already made the life bar but how do I get money from killing them so I can save that money to later make the purchase store?
@@CodeMonkeyUnity plis help me bro