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 Yuemari · Aug 07, 2012 at 12:37 AM · physicsiosprofilerissuesspikes

Profiler Physics.Simulate spikes

Hi guys, Im having a big issue with the game Im developing, hope you guys can help me understand these profiler values and how to avoid them.

First Im going to give you some Background about the game, it is a 3D Endless Runner for IOs devices , in wich the world is continuously spawning the obstacles and rewards the player can obtain, every spawned thing comes to the player. Everything the player can take or hit have a collider( only primitives )+rigidbody (Kinematic) and some obstacles have more than one collider. We are using a spawn pool that teleports the objects far away from the player and disable some scripts,renders and colliders, letting active only animated objects.

However this obstacles some times have complex hierarchies and when we move them back to the spawn point a large physics.simulate spike shows up in the profiler? Can´t figure it out, and haven´t found anything about these internal method. The profiler is reporting a high number of rigidbodies active, but low contact points and the proyect collision matrix is already fixed to just check collisions betweeen the correct layers.

Here is an image of the profiler:

alt text

If more information is needed to understand the problem info could be provided. Hope you guys can help me understand the problem or set me in the right direction.

profiler.jpg (94.8 kB)
Comment
Add comment · Show 2
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 dart4140 · Mar 21, 2014 at 01:12 PM 0
Share

Have you solved the issue ?

avatar image Yuemari · Mar 21, 2014 at 10:10 PM 0
Share

$$anonymous$$ind of, at the end we decide to rebuild the way the world was builded because moving really complex hierarchies was the problem, as I mentioned in the comments from before, all the objects have colliders with rigidbodies and move them all together (sometimes more than 200 gameobjects) wasn´t and option because it is really heavy for the processor, so we change the world and we dont move a lot of things now, just the player and some other stuff. To resume at the end moving a lot of objects in a deep and complex hierarchy can hit the performance, at least that happened in our project. Hope this helps you alittle bit.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by dannyskim · Aug 08, 2012 at 01:27 AM

I'm not exactly sure if this is the right answer, but from my experience, this is due to Mesh Re-Computation.

Assuming your obstacles are using a Mesh that you made in a 3D modeling program and imported in, every time the object comes back on screen, the Physics engine is re-computating a complicated mesh. The only solution that I have come across that works to alleviate this problem is using compound colliders ( several primitive colliders ) instead of the imported mesh for collision purposes.

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 Yuemari · Aug 08, 2012 at 01:47 AM 0
Share

I thought of that too, but right now I'm using only primitive colliders (box and spheres only) even on those meshes that have multiple colliders, if that is not the problem what else might it be? I have read across some threads that moving complex hierarquies is bad for Unity, but havent found proof of that. Aside from that i dont know what else could it be. ='(

Thanks anyway, I'll double check about colliders, just in case.

avatar image dannyskim · Aug 08, 2012 at 01:49 AM 0
Share

Does your OnCollisionEnter / OnTriggerEnter code blocks have some pretty long / unoptimized code? Are your objects with compound colliders moving without rigidbodies? some other things to think about...

avatar image Yuemari · Aug 08, 2012 at 02:42 AM 0
Share

Nope, actually the only one checking OnTriggerEnter events is the player which at the spawn moment is away from the spawn point ( but still visible ) and every collider in the scene have a rigidbody marked as kinematic and with all constrains turned on, that is because all the movement is done via scripting. Any other thing that you guys can think of?

avatar image
0

Answer by Yuemari · Aug 08, 2012 at 03:06 AM

I've noticed that every time there is a spike there is also a increase/decrease of the active Rigidbodies, does moving a lot of Kinematic Rigidbodies is bad for Unity? sleeping/awaking lots of Rigidbodies eats the CPU ?

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

10 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

Related Questions

Physics.Simulate taking a long time 1 Answer

Spikes on iPhone3/4 every other minute. Any ideas how to find out why and/or get rid of them? 1 Answer

Moving Colliders giving me Physics.simulate spikes in Profiler 2 Answers

Unity iOS Not Returning Pages 0 Answers

Physics madness: 270º != 270º - Please help 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