Instantiate vs Object Pooling

So, I was wondering if it is better to use Instantiate for projectiles and for text damage vs using object pooling. I know that Instantiate takes more time and it’s not a good idea to use it when it’s called a lot in a very short period of time, but could object pooling make the difference here too or it doesn’t matter?

If you’re using the same object, over and over again, it uses less resources to object pool than create and destroy the object over and over again.

That being said, sometimes it’s not worth the effort to do it. But it’s a good exercise to learn how to do it.

Hmmm… Now that I think about it, because we change the projectiles when we change the weapon, I don’t think it’s a good idea. We could repopulate the list of projectiles when we change the weapon and use the object pooling but I still don’t think will be a noticeable difference.

Thank you.

This is exactly the challenge of object pooling when it comes to projectiles. There are other classes, such as the DamageText, that could benefit greatly from pooling (as it’s always the same GameObject).

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.