EASY Object Pooling - Unity Game Tutorial

Sdílet
Vložit
  • čas přidán 28. 08. 2024

Komentáře • 21

  • @GameCodeLibrary
    @GameCodeLibrary  Před 3 měsíci +2

    You can grab this whole mini game package on itch.io for $2.99!
    Or on Patreon for £3
    (Whichever is cheaper for you - taxes on itch.io can up the price for non-US 😱)
    gamecodelibrary.itch.io/mini-space-shooter-with-object-pooling
    www.patreon.com/GameCodeLibrary/shop/mini-space-shooter-with-object-pooling-204034?source=storefront
    Alternatively, you can support the channel and join our Patreon for £5 - gaining access to ALL code from ALL videos!
    www.patreon.com/GameCodeLibrary
    Either way - hope you enjoy! 😇🙏

  • @miladyghost
    @miladyghost Před 3 měsíci +3

    I’m about to make the best game in the world thanks to all of your amazing tutorials 😅🦆

    • @GameCodeLibrary
      @GameCodeLibrary  Před 3 měsíci +1

      Haha yay I can't wait to play your game!! Thank you as always for your support :-)

  • @seaderwerks3046
    @seaderwerks3046 Před měsícem

    I just wanted to say thank you.
    I've been stuck on a spawning prefab issue now for a few days and just recently came across this video you uploaded.
    Implemented a similar approach and now my fishing mini game works in my game. Thank you for this tutorial.

    • @GameCodeLibrary
      @GameCodeLibrary  Před měsícem

      So glad I could help!! I love this method of spawning objects since you can reuse this script over any game in the future 🙏 hope your game goes well!

  • @rvargas0972
    @rvargas0972 Před 3 měsíci +2

    you're very smart, charismatic and lovely, I love your videos not in any bad way I mean. thank you so much for everything! :3

    • @GameCodeLibrary
      @GameCodeLibrary  Před 3 měsíci +1

      Thank you!! :-) So glad you enjoy the videos! I'll keep working hard and try getting better and better at them too! Thanks again I appreciate your kind words a lot!

  • @mattrobb3566
    @mattrobb3566 Před 3 měsíci

    Thanks another brilliant tutorial. Key takeaway was that the Object pool sizes can expand, a point often missed! Excellent delivery speed too, delivery was slightly slower than some of your other videos. I like that more.

    • @GameCodeLibrary
      @GameCodeLibrary  Před 3 měsíci

      I’m glad you enjoyed!! I did try to slow down the pace a bit - while still keeping it stream line. Glad it worked well! I’ll try keep a smoother pace in future 🙏

  • @GiangNguyen-ho5st
    @GiangNguyen-ho5st Před 3 měsíci +2

    I always forget to reset the state of the object pooled. Like if you enemies have HP or your bullets have lifetime, must remember to reset them OnEnable or OnDisable.

    • @GameCodeLibrary
      @GameCodeLibrary  Před 3 měsíci

      Yes!! That is a tricky bit! Perhaps you can store your defaults and call a function that sets your object back to default before disabling and returning it to the pool 🤔 At least it's an easy fix :p

  • @maciusbrawler9482
    @maciusbrawler9482 Před 3 měsíci

    🙂

  • @fabian_ftn6604
    @fabian_ftn6604 Před 3 měsíci

    Hello, You don't have a discord server? I tried Joining with the link but seems link is dead

    • @GameCodeLibrary
      @GameCodeLibrary  Před 3 měsíci +1

      Ahh yeah it was there but it seems to have vanished!! I'll have to make a new one and update all the descriptions when I have time some day 🥲

    • @GigaBizzy
      @GigaBizzy Před 2 měsíci

      make sure to create an invite link that never expires​@@GameCodeLibrary

  • @cerritosrules
    @cerritosrules Před 3 měsíci

    Wouldn't creating a new enemy object if all 10 enemy objects are active lag the game? That means it will endlessly spawn enemies with no limit?

    • @GameCodeLibrary
      @GameCodeLibrary  Před 3 měsíci +1

      That depends on your spawning code! You can set a limit on the spawner. The object pool stays generic so can have unlimited creations or a limited amount, depending on how you use it!
      This keeps the object pool script generic and reusable for all features.

    • @cerritosrules
      @cerritosrules Před 3 měsíci

      @@GameCodeLibrary I see that makes sense. I think I need to apply this to items that drop from my enemies too lol

    • @GameCodeLibrary
      @GameCodeLibrary  Před 3 měsíci +1

      @@cerritosrules That's a good idea!! Really good use case to use it for item drops :o

    • @cerritosrules
      @cerritosrules Před 3 měsíci

      @@GameCodeLibrary Do you plan on making more videos to improve performance for games? They are very helpful thank you!

    • @GameCodeLibrary
      @GameCodeLibrary  Před 3 měsíci +1

      @@cerritosrules Yes I'd love to keep covering game performance improvements!!
      Everything I make I try to make modular and the best way possible (or at least the easiest way with best performance haha!) So hopefully I can continue that as well :-)
      Thanks for your kind words!! Means a lot!