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
2
Question by Team_26 · Jun 26, 2014 at 07:01 PM · physicsrigidbodyfpscollisions

Physics optimization

Hi! I used Profiler to find reason of low FPS in my game. And I seen that about 90-99% of CPU Usage is in Physics (in some moments).

Some more statistics: - Active Rigidbodies: 870-930 - Sleep Rigidbodies (Sleep Velocity - 0.15): about 30 - Number of contacts: about 3K - Static Colliders: about 200 - Dynamic Colliders: about 1K

I know that there're a lot of rigidbodies and a lot of collisions in this game, but I can't remove any rigidbody or subtract the number of collisions. I use ONLY Box Colliders, there aren't any mesh colliders in my game.

I hope you can help me...

Comment
Add comment · Show 1
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 tanoshimi · Jun 26, 2014 at 07:07 PM 0
Share

I'm not sure what help anyone can give... you've already observed that physics calculations is your biggest bottleneck, yet you've also said that you can't remove any rigidbodies or subtract the number of collisions. So you've got little alternative but to accept the inevitably low frame rate.

3 Replies

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

Answer by Nabeel Saleem · Jun 26, 2014 at 07:46 PM

Do some changes in timstep goto edit > project settings > time

Set Fixed TimeStep to 0.01 in Time Manager.

and also change solver iteration count from 7 to 1 in physics setting. /

check your objects delete non-sleeping rigid bodies if they don't needed.

Comment
Add comment · Show 9 · 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 Team_26 · Jun 26, 2014 at 08:23 PM 0
Share

Setting FixedTimeStep makes some negative changes in my game :(

avatar image Mike-Geig ♦♦ · Jun 26, 2014 at 08:34 PM 1
Share

Because you went the wrong direction. Set it to .05 and see how it does

avatar image Nabeel Saleem · Jun 26, 2014 at 09:12 PM 1
Share

@Team_26 do some more changes in time and physics you will get good result. make your objects in uniform scale

avatar image Team_26 · Jun 27, 2014 at 07:40 AM 0
Share

If I change it from 0.02 to 0.025 there're much no-realistic behaviours of my objects...

avatar image Mehrdad995 · Apr 24, 2020 at 08:48 PM 1
Share

0.01 (100 physics frame get calculated for a single second) for fixed timestep is ridiculously high especially if you are targetting mobile devices. I get a pretty good result with 0.033 (30 physics frames get calculated for a single second).
And changing iteration counts from 7 to 1 will probably give you a pretty inaccurate physic result.

Show more comments
avatar image
1

Answer by screenname_taken · Jun 26, 2014 at 07:16 PM

Do you need all those rigidbodies active all the time? I mean you have them in the screen affecting the player?

Did you try tweaking the collision layers and the solver iteration counter?

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 · Jun 26, 2014 at 07:51 PM

Without knowing the details of your game I'm not sure if this will work, but in some cases combining multiple box colliders into a single mesh collider can be more effective. This is how Mine Craft works. It doesn't have thousands of cubes with colliders, it has a single mesh collider that gets updated every time a cube is moved.

Comment
Add comment · Show 3 · 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 Team_26 · Jun 26, 2014 at 08:23 PM 0
Share

But how can I make something like this?

avatar image Kiwasi · Jun 26, 2014 at 10:56 PM 0
Share

I found this tutorial really useful. Again, not sure if the technique is valid for your game. Try the other solutions as well.

avatar image Team_26 · Jun 27, 2014 at 07:36 AM 0
Share

Thank you. I think it isn't good for this game (because some box are in other position and rotate and in some moments they aren't colliding), but it can be useful in future.

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

24 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

Related Questions

Mesh Collider colliding with Primitives is jittery 1 Answer

RigidBody controller - Where to start? 0 Answers

Collisions occassionaly fail. 4 Answers

Low framerate on physics initialization. 0 Answers

How do I keep rigid bodies from sliding when applying fake gravity based on moving parent? 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