Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Triqy · Dec 06, 2013 at 11:39 PM · mobileperformancepoolinginstantiating

Pooling or Instantiating Enemies?

Making a game for mobile.. What would be better on performance? Pooling or Instantiating Enemies?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by ThePunisher · Dec 07, 2013 at 12:33 AM

Oh man, that's a simple answer. Pooling is much more efficient than having to destroy and instantiate/initialize several objects repeatedly, each containing several components.

We had a game loading a scene which was blowing away a bunch of plants from the previous scene and instantiating new ones. This scene would take several seconds to load up and then would still cause a lag spike as the objects were initialized. Once I changed it to pool the plant objects and simply update the textures and animations it completely removed the lag spike.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Triqy · Dec 07, 2013 at 12:52 AM 0
Share

Ok so that answers that! Thanks. Ive started to pool the enemies but ran into the issue of my enemies(Jets) no longer find the player using FindTag & LootAt. $$anonymous$$y Jets just sit there... Ive made a Script to find the all the transform by name and then force the ones that i find by specific name and force them in a transform Array and add individual numbers on the end of the names so i can look them up by way of "Jet_0", "Jet_1", "Jet_2"...etc..

Just cant figure out why my jets cant find my player

avatar image ThePunisher · Dec 09, 2013 at 06:50 PM 0
Share

Well, if you are pooling your jets now they are definitely not calling Awake and Start, and that's probably where you had your logic for finding the player. You'll have to call some initialize method on them as soon as you re-use them out of the pool.

avatar image
1

Answer by Raiden-Freeman · Dec 07, 2013 at 12:41 AM

If the amount of enemies is low, it doesn't matter. It also depends on their meshes/textures and other things, like the phones you're targeting.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Triqy · Dec 07, 2013 at 12:47 AM 0
Share

The amount of enemies are low but i have already pooled around 800 to 900 building gameobjects above the camera to be used for city destruction so i could just switch different types of the same building out.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Coin Magnet Performance Issue Mobile 3 Answers

2D optimization help, im going crazy... 4 Answers

big terrain performance && mobile 1 Answer

Game view performance VS actual build performance 2 Answers

founding the bottlenecks of a game for mobile device 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges