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 maxkunes · Sep 22, 2014 at 11:28 PM · unity 5gameobjectunity5instantiation

Instantiation and Deletion very slow... HELP..

So I am making a game, which you can go on forever, like minecraft but 2d, and im going to use cubes. But the issue with this, is that for some reason if I am running on an update function, I am only able to generate about 30 blocks a second, when my framerate is upwords of 300... This is the same for Delete(gameobject)...

Please help - Max

Comment
Add comment · Show 3
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 Slev · Sep 22, 2014 at 11:35 PM 0
Share

If you want to get technical Update occurs more often than frames do. Likely the engine has some sort of internal limitation to prevent massive instantiation bursts. $$anonymous$$inecraft actually instantiates fairly slowly when possible.

avatar image Kiwasi · Sep 23, 2014 at 12:04 AM 0
Share

I'm surprised you have access to Unity 5 without understanding that Instantiate and Destroy are slow. $$anonymous$$y understanding is that the its still in closed beta. Only a few experienced and trusted developers have access. If you are using an illegal version I would strongly suggest you drop back to the currently supported free version. Otherwise you can take questions straight to your contact at Unity Technologies who provided you with the beta.

avatar image maxkunes · Sep 23, 2014 at 02:03 AM 0
Share

tags mean nothing, tags are to expand the wide range on which a post gets posted, so no I do not have Unity5, but yes I will continue to use the tags I want, so don't act like a child and go completely off subject.

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by dmg0600 · Sep 22, 2014 at 11:34 PM

Instantiate and Destroy are really slow instructions. You should use a pool of GmaeObjects instead of creating and destroying them.

Take a look at this pool tutorial.

If it does not set it clear for you, do some reserach as there are plenty of answers about GameObjects pools.

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 maxkunes · Sep 23, 2014 at 02:04 AM 0
Share

thanks I was thinking of doing that, but I didn't think of a great place to start. Thanks for the link

avatar image
0

Answer by 767_2 · Sep 22, 2014 at 11:36 PM

Instantiate and Destroy methods of unity are slow because of garbage collection and the alternative that is mostly used is object pooling , that you can make an object pooling system of your own (tutorial)or use a plugin like poolManager

Comment
Add comment · 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
0

Answer by Kiwasi · Sep 23, 2014 at 12:03 AM

For minecraft like games you should consider using a voxel generation method, instead of handling individual objects. This basically cheats by creating one huge GameObject, and modifying it as individual cubes are added and removes.

Object pooling also works

Comment
Add comment · 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

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

29 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Model not rendered on Android Lollipop 5.0.1 0 Answers

How can I Instantiate two new GameObjects at the same time? (Attempting Asteroids style game) 2 Answers

Why do some objects freeze on creation? 1 Answer

Build game in Window phone 8 platform. 0 Answers

Carousel or Swipe Menu 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