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 Freaking-Pingo · Oct 25, 2013 at 08:29 AM · physicsrigidbodyperformancecollidersprofiler

Active rigidbodies and number of Contacts

Hi there Uniteers. In the attempt of increasing the performance within our game, I noticed our Physics.simulates eats up 14% of our performance (1.51 ms)

In order to reduce this, I looked into the Physics profiler and noticed that in our game we have:

  • 85: Active Rigidbodies

  • 0: Sleeping Rigidbodies

  • 130: Number of Contacts

  • 800: Static Colliders

  • 49: Dynamic Colliders

The problem is we are not using any physics within our game. All our NPCs have an attached rigidbody due to the fact that if you move a collider without a rigidbody this will create overhead. All rigidbodies have been marked with "IsKinematic", which I believed would put all the rigidbodies into sleep mode.

Am I missing something completely fundamental here? I have tried using rigidbody.Sleep() without succese.

Comment
Add comment · Show 4
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 pako · Oct 25, 2013 at 08:50 AM 0
Share

Are your NPCs moving? Because if they are moving they will not sleep. According to the documentation: "There are two variables that you can tune to make sure your rigidbodies automatically fall to rest: Rigidbody.sleepVelocity and Rigidbody.sleepAngularVelocity. Those two variables are initialized to the sleepVelocity and sleepAngularVelocity variable defined in the Physics $$anonymous$$anager (Edit -> Project Settings -> Physics)"

See: http://docs.unity3d.com/Documentation/Components/RigidbodySleeping.html

avatar image Freaking-Pingo · Oct 25, 2013 at 09:01 AM 0
Share

They are actually not moving when the player is not nearby, but we are currently using $$anonymous$$ecanim, and it tends to move the transform slightly. I'll look into this, thanks for the advice. I'll report back.

avatar image Freaking-Pingo · Oct 25, 2013 at 09:05 AM 0
Share

Tried both variables, nothing seems to work.

avatar image Statement · Oct 28, 2013 at 02:23 PM 2
Share

Experience have proven to me that it may be hard to entirely eli$$anonymous$$ate the static collider problem that you describe. Even if you feel 100%, sure that nothing is moving objects that lack rigidbodies, check the profiler CPU Graph for any nested expensive collider move entries. It will say something like "delayed cost".

1 Reply

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

Answer by Freaking-Pingo · Oct 30, 2013 at 08:32 PM

I never really figured out what went wrong in this situation, but my solution to this was simply to disable the collider on the same gameobject that had the rigidbody. In this way there rigidbody could "Sleep".

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

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

Should rigidbodies be destroyed as they fall out of stage? 1 Answer

Not all sides of a cube collide properly( with pic) 2 Answers

Moving a regular Unity primitive and PhysX performance 0 Answers

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

What is Physics2D.Simulate, and why is it chewing up more than 100ms of frame time? And why does this not happen when using 3D physics? 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