• 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 Oh my goth... · Oct 05, 2014 at 09:13 PM · graphicsoptimization

Best way to smash a Cube made out of 100x100x100 cubes.

I need to create a big 100x100x100 cube made out of smaller 1x1x1 cubes and then smash it into peaces.

I understand, that I only need to create as much mini cubes as I need to cover the surface, but I don't know what is the best method to adding additional cubes after the surface ones are destroyed/removed.

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

Answer by robertbu · Oct 05, 2014 at 09:18 PM

The mega-cube you describe would have one million cubes. There is no way Unity will run reasonably (at all???) with a million game objects. Just the sides will have around 60,000 cubes. If the cubes have no scripts and a light-weight shader, you might be able to get reasonable performance out of 60,000 cubes on a desktop.

If you really needs this, search out references on Unity Answers and elsewhere to Voxels and Minecraft. The concept is building multiple cubes out of a single mesh. Even then you'd need 250+ meshes each with 4K of cubes in order to get your million cubes.

Comment
Add comment · Show 4 · 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 Oh my goth... · Oct 07, 2014 at 12:01 PM 0
Share

I did mention in my problem that : "I only need to create as much $$anonymous$$i cubes as I need to cover the surface". So ins$$anonymous$$d of having a million cubes i would only have (100 + 90 + 90 + 90 + 90 +60? = 500 cubes). $$anonymous$$y question was/is what is the best way to add additional cubes after the surface ones are removed

avatar image AlucardJay · Oct 07, 2014 at 01:29 PM 0
Share

You could use a particle effect, make a spritesheet with several frames of a rotating cube.

avatar image Andres-Fernandez · Oct 07, 2014 at 01:33 PM 0
Share

This thread used to be some sort of reference to people trying that.

avatar image robertbu · Oct 07, 2014 at 01:33 PM 0
Share

Each side will be 100 x 100 cubes (give or take), so just doing the sides is around 50,000 cubes, not 500. For the explosion, you are going to have to have the surface cubes plus at least some percentage of the interior cubes. Using 50,000 is problematic. Using 150,000 or 250,000 like you'll need for a good looking explosion is unusable. I've run some Unity apps using 50,000 game objects on my desktop. They were non-moving objects with shared material and batched, and the app ran vary slowly. If you don't believe me, 15 $$anonymous$$utes of coding should allow you to build the surface cubes, and you can test it yourself.

If you really want this to work, then you are going to have to figure out alternate solutions. $$anonymous$$aybe a ParticleSystem. $$anonymous$$aybe Voxles. $$anonymous$$aybe some sort of shader magic.

avatar image
0

Answer by Cherno · Oct 07, 2014 at 01:05 PM

You create teh mesh by code, like Minecraft clones do. RobertBu already mentioned Voxels and MC. So If the surface cubes are recmoved, you would recreate the mesh(es) to make the next layer.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity Blob shadow projector massive tris amount, why? 1 Answer

Countdown little help...! 1 Answer

Optimizing trees (Or any large batch of objects) in Unity 0 Answers

Ghosting with Oculus Rift DK2 1 Answer

Is it possible to calculate batch count of each material ? 0 Answers


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