Object Pooling in Unity
Soda Rocket Studios
In this video, we discuss when and how you can use object pooling in Unity. We start by building a simple project that instantiates projectiles when you fire, then modify it to use an object pool.
-------------------------Contents------------------------- 0:00 - Intro 0:40 - When and why you should use object pooling 1:30 - Instantiating objects 3:50 - Creating and initializing an object pool 6:35 - Spawning objects from a pool 10:45 - Initializing objects properly 13:15 - What if the object pool is too small 15:25 - Putting the objects in a container 16:18 - Creating an object pool interface 19:50 - Switching to a singleton 20:35 - Spawning waves of objects
Please consider supporting my work with the links below. https://www.buymeacoffee.com/SodaRocket https://www.paypal.com/donate?business=2XAWU43T4DFVG&no_recurring=0¤cy_code=USD ... https://www.youtube.com/watch?v=1WxGmYgO6yE
112771261 Bytes