An example of coding an Object Pool in Unity.
Drag and drop the Turret prefab into the scene, play the game and press space to launch a bullet via the Object Pool.
Note, there's room for improvement. E.g. rather than returning null, you can generate a new object instead and add it to the pool. Good luck :). For questions, please feel free to comment on YT: https://youtube.com/shorts/-7Kbu6Gsao4