• 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 a.smolov · Jul 26, 2013 at 10:45 PM · physicsrigidbodyperformanceprofiler

Should rigidbodies be destroyed as they fall out of stage?

In order to test my computer and Unity3d profiler, I set a scene with a plane and 1800 cubes. Each cube has rigidbody and collider attached.

alt text

There is one thing I do not understand. As my "game" progresses, cubes fall out of stage, and their geometry is destroyed. In the Rendering row, you can see that number of draw calls, triangles and vertices decreases over time as expected. Something I am surprised of is that number of active rigidbodies stays the same all the time.

alt text

Isn't rigidbody supposed to be destroyed as it falls off the stage?

screen shot 2013-07-27 at 2.36.14 am.png (184.5 kB)
screen shot 2013-07-27 at 2.37.01 am.png (181.2 kB)
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

1 Reply

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

Answer by dorpeleg · Jul 26, 2013 at 10:50 PM

The geometry is not destroyed, it's just not rendered because your objects are out of the screen.

Rigidbodys are not graphical, they are psychical.

So psychics is still calculated even if objects are off screen.

Comment
Add comment · Show 5 · 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 a.smolov · Jul 26, 2013 at 10:53 PM 0
Share

Thank you for your answer! That explains a lot, but am supposed to destroy rigidbodies myself, if I have it somewhere offscreen? Or is there some "AutoDestroy" checkbox for rigidbodies in Unity somewhere?

avatar image dorpeleg · Jul 26, 2013 at 10:59 PM 0
Share

As far as I know, there is no built-in way to do it.

If you want rigidbodys to be destroyed when off screen, you will have to script it

avatar image a.smolov · Jul 26, 2013 at 11:01 PM 0
Share

Got it! Thanks again!

avatar image AlucardJay · Jul 26, 2013 at 11:21 PM 0
Share

If you're really worried about performance, you should not be using Instantiate and Destroy, rather you should make the objects active/inactive and store them in a pool. Check the AngryBots demo, and how the bullets and missiles are managed. http://www.google.com/search?btnG=1&pws=0&q=unity+pool+objects+

avatar image a.smolov · Jul 26, 2013 at 11:53 PM 0
Share

Thank you, @alucardj! I will take a look.

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 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

Related Questions

Active rigidbodies and number of Contacts 1 Answer

Why Physics perfomance cost get huge when static geometry is added ? 0 Answers

Spikes with Physics.Simulate() in empty scene? 0 Answers

Rigidbody Overhead 1 Answer

Making a physics based game run faster 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