The Ultimate Clean, GENERIC Object Pool System (Unity Tutorial)

Subscribers:
65,200
Published on ● Video Link: https://www.youtube.com/watch?v=Ah3epb2HGCw



Duration: 0:00
6,791 views
276


Cropolution now on Steam: https://store.steampowered.com/app/3291660/Cropolution/
Show your Support & Get Exclusive Benefits on Patreon (Including Access to this the advanced version of this project on github) - https://www.patreon.com/sasquatchbgames
Join our Discord Community! - https://discord.com/invite/aHjTSBz3jH

--
Over the years I've made dozens of tweaks to my object pooling system, and I think I finally have the perfect one, which is what you're seeing here! My favorite part is that it utilizes generics so you have return (or pass in) ANY type, just like with the Instantiate method.
I really hope you guys enjoy!

--
Timestamps:

00:00 - What we're making
00:50 - The object pooler foundation
03:19 - Setting up Unity's ObjectPool
06:57 - Creating the Generic SpawnObject method
10:10 - How to return objects to the pool
10:59 - replacing instantiate and destroy + calling different types
12:12 - Creating an overload method to handle parenting pooled objects

---

In need of more Unity Assets? Using our affiliate link is a great way to support us. We get a small cut that helps keep us up and running: https://assetstore.unity.com/?aid=1100lwgBQ
---
Looking for some awesome Gamedev merch? -
---

Link to Download our FREE 2D Asset Pack:
https://assetpack.sasquatchbstudios.com/

Good C# generic explanation:
https://onewheelstudio.com/blog/2020/12/27/c-generics-and-unity

Who We Are-------------------------------------

If you're new to our channel, we're Brandon & Nikki from Sasquatch B Studios. We sold our house to start our game studio, and work full time on building our business and making games

Don't forget to Subscribe for NEW game dev videos every Thursday!

Wishlist Samurado!
https://store.steampowered.com/app/2343270/Samurado/

Follow us on Twitter for regular updates!
https://twitter.com/SasquatchBGames

#unitytutorial #unity2d #madewithunity