Object Pool for multiple objects

I’m making a game like jetpack joyride and I want to make a object pool for multiple obstacles and coins; however I could not. Can you help me?

If you Google “unity object pooling” you’ll find lots of information including tutorials.

I found but they are not for multiple gameobjectsi they are for single object.

When you say multiple gameobjects do you mean you want a single pool to have different gameobjects in it?

Yeah There are 4 different prefabs like coins,lazers,rockets. I want to make a single object pool for all of them to spawn randomly.

Ok, so what part of the problem are you stuck on?

And why don’t you want to use multiple pools?

I do not know how can I do. I am a beginner

Start simple and make 4 pools.

Have you looked at the tutorials? A lot of people come here asking questions without actually working through the tutorials. If you work through them this question will be answered.

Please go to: Object Pooling - Unity Learn

and https://www.raywenderlich.com/136091/object-pooling-unity

FYI, I found those links by typing “object pooling unity” into google, they were the first 2 links. If you find your not sure where to begin, then always follow tutorials before asking on here as you wont know what questions you need to ask, so we wont know how to answer properly.

Actually, I looked these tutorials but in these tutorials there is a single object (bullet) I want to make pool with 4 objects and they are overlapping when I make 4 pools. I just wanted to spawn obstacles and coins randomly as in jetpack joyride

You can use my object pool GitHub - Ven0maus/UnityObjectPooler: A unity object pool that works with any unity component.
It allows you the specify an interface to each type of object, and allows you to pass the interface to the pool.