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:

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.

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.

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 ?