How to make a simple Shop in Unity

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 178

  • @paperkid6821
    @paperkid6821 4 года назад +113

    Finally now I can sell drugs and guns

  • @williamsauer3546
    @williamsauer3546 4 года назад +48

    No one:
    Me in the description: Bippity Boppity your thing is now my property

  • @gamedevgoose9887
    @gamedevgoose9887 4 года назад +31

    Finally a solution for my underground milk cartel. Very cool!

  • @karam7399
    @karam7399 4 года назад +13

    never been this early in my life ,this says something

  • @Blinkers2007GameDev
    @Blinkers2007GameDev 2 месяца назад +1

    This stuff is GENIUS! Thank you for this tutorial! this is exactly what I needed and I learned alot from your video

  • @NasojGnehzStudioRetry
    @NasojGnehzStudioRetry 10 месяцев назад +1

    Thank you for making one of the only few unity shop video that is understandable.

  • @RedTopAnimation
    @RedTopAnimation 8 месяцев назад

    thank you woman from 3 years ago it really helped, the only working shop tutorial that i found

  • @voxelkooow
    @voxelkooow 2 года назад +8

    Great, thanks. Small suggestion: Use UI.Image component instead of SpriteRenderer (icons), because when scrolling the text disappears, but the sprites remain visible.

  • @sylvsyntax
    @sylvsyntax 4 года назад +4

    I was going to write something about the bad practices but I saw you got a few of those. Its a good start however. Theres a lot to learn and for a lot of beginners, its a good starting point.
    When you go over the saving system, look into binary formatting with classes instead of player prefs

    • @luckyknot
      @luckyknot 4 года назад +3

      It's nice to have more experienced devs helping by giving hints like this, a pity you do not have any videos to check in your profile you could teach a whole deal i'm sure :P

    • @sylvsyntax
      @sylvsyntax 4 года назад +1

      @@luckyknot i have another account but Im also transitioning so Im avoiding my dead name a bit.

    • @luckyknot
      @luckyknot 4 года назад

      @@sylvsyntax i understand, i'm very interested in following you, add me somwhere! :P

    • @Deridealized
      @Deridealized 9 месяцев назад

      Binary formatting should never be used, it is insecure and not recommended by microsoft to be used.

  • @emad-dev
    @emad-dev 4 года назад +11

    Great job, you can make a class or struct that hold information for each button, that will help you to save buttons information later.
    The using of update function in each button is bad practice.
    instead of thet the using of the Interfaces of EventSystem such as IPointerDown or IPointerUp is good practice, and that will give you good performance 👍.

  • @DarkPlaysThings
    @DarkPlaysThings 4 года назад +4

    Been looking for a tutorial like this for a while. Nice!

  • @g5haco
    @g5haco 4 года назад +6

    No one:
    Zyger: PirceTxt

  • @devvydoesstuff
    @devvydoesstuff 4 года назад +2

    Finally I can sell the secret 100% white milk powder

  • @StacyMcCabe
    @StacyMcCabe 4 года назад +3

    How to make shop
    Simple: Potion go burr
    Long: watch the video

    • @StacyMcCabe
      @StacyMcCabe 4 года назад +1

      @Mr Maniac you need to edit your comment. It doesn’t apply anymore

  • @reubenrk3406
    @reubenrk3406 4 года назад +1

    Yey. Finally, my shopping system works

  • @StacyMcCabe
    @StacyMcCabe 4 года назад +12

    I use scratch lol. I need a pc and then I will start coding. Real codeing, not scratch coding (unity, python, etc.) I started coding at 11 and I am 12. I am excited for the future.

    • @gramoner7310
      @gramoner7310 4 года назад +1

      same here xD

    • @viliusraguotis1618
      @viliusraguotis1618 4 года назад +1

      I strongly recommend rnd as a 15 years old game developer firstly understand what is objective programing and learn python before you start c# trust me its really useful (btw i am a game dev for 4 years so i know my shit)

    • @StacyMcCabe
      @StacyMcCabe 4 года назад +1

      @@viliusraguotis1618 I have coded in html. I know python but I can’t code in python.

    • @StacyMcCabe
      @StacyMcCabe 4 года назад +2

      @@viliusraguotis1618 I am exited to see what awaits. If you have a game then I would be eager to play it.

    • @StacyMcCabe
      @StacyMcCabe 4 года назад +1

      @Mr Maniac just saying the younger you are the easier it is. Code now not later. I am 12 so I need to start

  • @aliciadiaz8020
    @aliciadiaz8020 2 года назад

    This saved me from despair XD
    Thank you very much, great job

  • @scratchtutorials1068
    @scratchtutorials1068 4 года назад

    wow Zyger I am excited that you have started to make tutorials!

  • @lucasjhonatan1342
    @lucasjhonatan1342 2 года назад +1

    Awesome tutorial, I added the Event System library and the option GetComponent().currentSelectedGameObject doesn't appear as an option for me, I know this is a Unity bug, but it's driving me crazy, is there another way to do this without needing to use currentSelectedGameObject ?

  • @bennettkrubakar4412
    @bennettkrubakar4412 4 года назад

    Had to wait a long time for ur new video.This tutorial was worth the wait. Gr8 job😉👍

  • @Agent-zg5ec
    @Agent-zg5ec 4 года назад +1

    Thanks for tutorial. In time when I needed.

  • @BORDEV
    @BORDEV 4 года назад +1

    Gotta get that tutorial bread

  • @MokarromHossain
    @MokarromHossain 4 года назад

    Me when Zyger becomes serious : Wait a minute ? Who are you ?

  • @girofare
    @girofare 3 года назад

    Perfect. Thanks ! The Only one tuto of it I've found in youtube !

  • @jaspervanhaalen371
    @jaspervanhaalen371 Месяц назад

    Hey it didn't work for me :( I keep getting " Object reference not set to an instance of an object" error about the ShopManager in the ButtonInfo script.
    I'm also using a different value than coins (with prefs) & I can't drag mine into 'Price Txt' on the ButtonInfo script on Item1.. idk if this is related? Please answer i could really use ur help, it's for a school project

  • @carljohnson75
    @carljohnson75 4 года назад +2

    Yesssss!!!
    MAKE MORE TUTORIALS LIKE THIS :))))

  • @jaiminvashi4704
    @jaiminvashi4704 4 года назад +3

    I really want a tutorial series about multiplayer games in unity plssssss×♾
    Since brackeys not making videos anymore i only trust you plsssssss×♾♾♾♾♾♾♾♾♾

  • @princeofpersia3254
    @princeofpersia3254 Год назад

    Why you put on 4:40 in arguments of the array two numbers 5 ? I would like to know purpose behind it, thanks in advance

    • @ZygerGFX
      @ZygerGFX  Год назад

      Honestly not sure now looking back. It was unevessary and didn't change anything so I guess you can change the number to however many items you want.

  • @HaramLord
    @HaramLord 4 года назад

    I think it would make sense to post the code to Github instead of making ppl download the code through google drive or something like that. It'll also help with keeping track of progress of the project!

    • @ZygerGFX
      @ZygerGFX  4 года назад

      That's very true thank you I'll try update is asap

  • @Husmanmusic
    @Husmanmusic 3 года назад +1

    I love this, just can't wrap my head around how to also sell items from my inventory and display my inventory in the shop UI. Any ideas?

  • @belkacemF
    @belkacemF 4 года назад +3

    i was gonna say ma man..but i remember you are a girl soo....you are the best indie developer girl....actually you are the only one i know🤔..its weird there is no too much girl developer

    • @2bee103
      @2bee103 4 года назад

      dani is a girl also

  • @ibpositive757
    @ibpositive757 3 года назад

    awesome tutorial! here's hoping for the save tutorial as well. Keep up the amazing work!

  • @jehanzeb11
    @jehanzeb11 4 года назад +1

    Your visual studio font colour combination is sickkk . Is there anyway i could get the same settings? Amazing video btw

    • @ZygerGFX
      @ZygerGFX  4 года назад +2

      It's called one dark pro

  • @charlesthedev
    @charlesthedev 3 года назад +1

    Fantastic tutorial, really great and even provided source code, 10/10 subbed

  • @meg1a445
    @meg1a445 4 года назад +1

    you should try to make Among Us in Core.if you like idea pls like so Zyger sees it.

  • @محمد-ن2ج2ج
    @محمد-ن2ج2ج Год назад

    Hi. Thanks for your great tutorial.
    How can we save it?
    When I exit from my shop changes disappear.

  • @mihail2217
    @mihail2217 Год назад +1

    Very informative video keep it up , but i keep getting an " Object reference not set to an instance of an object" error do u maybe know why?

  • @itsthemeg
    @itsthemeg 3 года назад +1

    Please make a saving the items purchased tutorial...

  • @blacklight8932
    @blacklight8932 3 года назад +1

    Assets\ButtonInfo.cs(16,32): error CS0021: Cannot apply indexing with [] to an expression of type 'GameObject'

  • @jaeik6343
    @jaeik6343 3 года назад +2

    Please tell me how to save it as playerprefs

    • @imanmanz
      @imanmanz 3 года назад

      I really need this too

  • @fikrimleweb6085
    @fikrimleweb6085 3 года назад

    Why do you use capital letters for variables? Is your choice? I'm asking because most of developer says you can use capital letters for methods.

  • @Husmanmusic
    @Husmanmusic 3 года назад

    Amazing tutorial! Thank you

  • @ShiNyChiDoRi
    @ShiNyChiDoRi 2 года назад

    I did all the same but my numbers does not come only Price text and quantity text comes

  • @isto_inc
    @isto_inc 4 года назад

    Same release day as amazon prime day. COINCIDENCE?!?

  • @magicpepe582
    @magicpepe582 3 года назад

    i though i am here to watch unity tutorial instead of learning rapping haha

  • @begreen2809
    @begreen2809 4 года назад

    Thanks for this! Super helpful!

  • @KhushalKhandelwal-ns4eu
    @KhushalKhandelwal-ns4eu Год назад +1

    i was unable to download file

  • @calllus9397
    @calllus9397 4 года назад

    Also thanks
    I'm going to probs use this information

  • @LearnWithArjun
    @LearnWithArjun 2 года назад

    it does not work how do u get ButtonInfo form event system if the script is not in the event system??

    • @LearnWithArjun
      @LearnWithArjun 2 года назад

      ok ya it works i was just did not tag the event system lol

  • @seb.5053
    @seb.5053 3 года назад +1

    Can you do a video about how to save data?

  • @SonuKumar-js5wv
    @SonuKumar-js5wv 2 года назад +1

    how to save gameobject ?

  • @arabiannights7183
    @arabiannights7183 3 года назад

    nicely explained. but your script doesnt work. and why you zip your whole project.. you should have zipped only the script and check the script has no error before zipping

  • @MeetSondagar-p7g
    @MeetSondagar-p7g 10 месяцев назад

    Make a same video on "How to make a Buying item or land in idle game in unity 3d".
    for example game name: Outlets Rush

  • @Saladon89
    @Saladon89 Год назад

    Awesome vid, Wheres the saving tutorial 😂😂??

  • @ArribaElMole
    @ArribaElMole 2 года назад

    Thanks for helping me

  • @viliusraguotis1618
    @viliusraguotis1618 4 года назад +1

    Very useful thanks

  • @bumba5727
    @bumba5727 4 года назад +1

    Great video

  • @MusicFlowDaily
    @MusicFlowDaily 3 года назад

    *Hi, much luv for the tutorials! :)*
    How to make it possible to buy a doubling of life in the shop?
    let's say usually in the game there are 3 lives, I want to be able to buy 6 in the shop (for just one session of the game). I can't find any tutorials on that topic. :(

  • @aj656666
    @aj656666 3 года назад

    That was a great explanation! Thank you!
    How can I save the number of coins that are left for other scenes? (As my item shop is having a different kind of items in different scenes)

    • @ZygerGFX
      @ZygerGFX  3 года назад +2

      User player prefs. you can save values and they get saved in between scenes and even after closing the application/game

    • @aj656666
      @aj656666 3 года назад

      @@ZygerGFX Thank you very much!

  • @FC12CGaming
    @FC12CGaming 3 года назад

    any way of implementing my custom score one for this code

    • @ZygerGFX
      @ZygerGFX  3 года назад

      What do you mean ? Can you explain ?

  • @Shrumpf
    @Shrumpf 4 года назад +1

    Thank you :)

  • @wanchester6626
    @wanchester6626 3 года назад

    can u make a video for the save system

  • @Corey_Snodgrass
    @Corey_Snodgrass Год назад

    My man is talking with a speed of 1.25. drop it to .75 to equal it out lol.

  • @gazzolapw
    @gazzolapw Год назад

    Download link is broken.

  • @marvicbautista7080
    @marvicbautista7080 3 года назад

    Can you tell me how to fix, I cant add the buy funtion on the button.

  • @gramoner7310
    @gramoner7310 4 года назад

    For some reason it says that there are 4 comments when actually there are like 30 xD

  • @halukddddd
    @halukddddd 2 года назад

    thank you

  • @resumosde5minutos694
    @resumosde5minutos694 Год назад

    amazing

  • @beanscompany6847
    @beanscompany6847 2 года назад

    thank you so much

  • @ahmedmoubarik168
    @ahmedmoubarik168 3 года назад

    Please make the second part

  • @FinalP0int
    @FinalP0int 4 года назад

    The ShopManager shouldn't have to care about the UI, the UI has to show the info provided by ShopManager. Check this video ruclips.net/video/vDrYDAMdpuc/видео.html

  • @jawwaadjanjua2716
    @jawwaadjanjua2716 3 года назад

    Could you make a level select in unity tutorial plz????

  • @3dssolidsnake
    @3dssolidsnake 3 года назад

    save and load system plez?

  • @sylwestermoniuszko-szymans1488
    @sylwestermoniuszko-szymans1488 2 года назад

    Interesting channel. I am facing now need of Item shop in the game that my daughter is making (I am doing scripts and music), and found your channel like this. I think I will have a little bit different approach. Since I have already my inventory system, currency and save system I think I need to build it on top of what we already have. So I was thinking about making script ShoppingItem, and then this would have reference field for prefab GameObject, because I have all the info I need on a ScriptableObject attached to the prefab, so I could read it from there. Then my ShopManager would only hold the reference to an array of ShoppingItem items, and to my currency.

  • @الشيخياسينالعمريالقناةالرسمية

    Please can you make part 2

  • @MaskMajor
    @MaskMajor 11 месяцев назад +1

    your username sounds like a racial slur for aliens, great tutorial tho!

  • @rodrigobogado653
    @rodrigobogado653 Год назад

    very goooddddddddd

  • @aw1lt
    @aw1lt 4 года назад

    MORE TUTS

  • @WolfsDenShop
    @WolfsDenShop 7 месяцев назад

    No Source. No Watch!

  • @kushalbaid
    @kushalbaid 4 года назад

    Nice

  • @MikeHasBeenCool
    @MikeHasBeenCool 4 года назад +1

    fem-dani

  • @graystripewt279
    @graystripewt279 4 года назад +2

    not first

  • @geekmashup6829
    @geekmashup6829 4 года назад

    hi

  • @GreenTea-Pose
    @GreenTea-Pose 4 года назад

    gg

  • @pedro-ms6te
    @pedro-ms6te 3 года назад

    hey! can u see your email? i have an issue

  • @phuchaotran4880
    @phuchaotran4880 Год назад

    use [SerializeField] pls

  • @jubileu-m8d
    @jubileu-m8d Год назад

    queria entender oque fala

  • @ultrahigh5961
    @ultrahigh5961 Год назад

    didn't work :/

    • @ZygerGFX
      @ZygerGFX  Год назад

      what exactly didn't work ? are you getting errors or ? also did you debug your code to see whats not working ?

    • @ultrahigh5961
      @ultrahigh5961 Год назад

      @@ZygerGFX I got an Out-of-Bounds error on a line where coins get substracted ("coins -= ...").

    • @ZygerGFX
      @ZygerGFX  Год назад

      @@ultrahigh5961 okay that means where you're removing coins for an index that doesn't exist. so like your length may be 3 and your trying to remove from array spot 3,4,5 6 ect one that's not in bounds. so just check the length of your array to double check, that its long enouogh and not under 0.

  • @dfgesfg
    @dfgesfg 4 года назад +1

    5.

  • @walney2008
    @walney2008 3 года назад

    please speak shop equal cs, and by arms gamer

  • @疯狂家居
    @疯狂家居 2 года назад

    牛逼

  • @AmilRaza-dl2zx
    @AmilRaza-dl2zx 6 месяцев назад

    .

  • @desert5651
    @desert5651 4 года назад +1

    first

  • @MrTomateSalat
    @MrTomateSalat 4 года назад

    I don't want to sound mean - but there are a lot of things one shouldn't do. I can understand that you didn't choose scriptableobjects for items in order to keep the tutorial short - but a multidim-array with magic-numbers is really a no-go. At least having a proper struct and use that in a list/array would've improved the code a lot. If you want to store it in a compact way later on in playerprefs - ok. But you can have mappers to transform data. There is really no reason why one should go with such errorprone data-structure. Next problem is that you don't cache your objects. Why fetching the EventSystem every time? Why grabbing it in a such complicated way? "EventSystem.current" would replace GameObject.FindGameObjectWithTag("Event").GetComponent(). Also it doesn't need any tag (which is also errorprone). Then it isn't clear why you store a ref to the gameobject and not to ButtonInfo. But in overall ShopManager anyway shouldn't know about buttons. Just think of the Single-Responsibility-Principle. The ShopManager should decrease the coins and increase the amount. Thats it. And it could be easily achieved if Buy just takes the necessary parameters. Those could be provided by the ButtonInfo-class. I don't understand why you take the shopManager as GameObject and not as ShopManagerScript. The call to GetComponent is just a waste of resources. And this ButtonInfo could trigger the buy-Methode on the shopmanager. The values then also don't have to be updated on every frame. You could do that on Start/OnEnable and after each button click. Also I want to point out: this is meant as constructive feedback and I don't want to offend you with that.

    • @kaypathy
      @kaypathy 4 года назад

      U know your shit,nice I guess?

    • @mudokin
      @mudokin 4 года назад +1

      Came here to say this, when trying something out, this might be okay, but it shows bad practices over and over.

    • @kaypathy
      @kaypathy 4 года назад

      @@mudokin wudym?

  • @daddadia5015
    @daddadia5015 4 года назад +1

    Oh Jesus it’s the girl who can’t even make a game look better than the original

    • @thinkthatgabs2316
      @thinkthatgabs2316 4 года назад +3

      Honestly dude you so toxic. I see you commenting every few hours. Look shes clearly trying to have fun while making videos. Not everything you do is going to be perfect and be the best outcome. But its props to her that she gave it a go. And instead of commenting the same thing over and over again on a youtube channel go do something fun for yourself. Instead of making someone feel worse about themselves. 👍