Physics2D increases activity when... not moving?

6212891--682793--lol.gif
As you can see in the profiler, the Physics2D increases over time when all the physics objects are still. But as soon as my Main character moves, the CPU usage becomes 0.

This problem makes me go from 160 fps to less than 20 in about 30 seconds. The profiler says that here’s the problem:

Physics2D.FindNewContactsFindJob

But I cannot imagine what’s going on and why it grows over time. I need a clue to where to look. Can anyone help me? I am really desperate on this one.

I think there’s a special physics section of the profiler that should say how many physics objects of certain types are in the scene. Have you looked at that? Maybe you have some invisible or off camera objects you forgot about?

Where is this section? The physics debug window shows nothing.

The point is that there’s no new items being created. There’s nothing happening, but it still grows.
This is the memory:
Used Total: 0.79 GB Unity: 180.7 MB Mono: 13.4 MB GfxDriver: 126.1 MB Audio: 9.0 MB Video: 0 B Profiler: 476.5 MB
Reserved Total: 2.31 GB Unity: 0.62 GB Mono: 17.2 MB GfxDriver: 126.1 MB Audio: 9.0 MB Video: 0 B Profiler: 1.54 GB
Total System Memory Usage: 3.06 GB

Textures: 885 / 54.9 MB
Meshes: 88 / 18.1 MB
Materials: 107 / 194.0 KB
AnimationClips: 54 / 357.0 KB
AudioClips: 30 / 7.0 MB
Assets: 5095
GameObjects in Scene: 781
Total Objects in Scene: 5345
Total Object Count: 10440
GC Allocations per Frame: 106 / 30.0 KB

All the rigid bodies are kinematic, so I would assume there’s no problem. But there is. I still don’t know where to start the search.

Sorry for the bump. I was not able to solve this. I just need a hint of what could be going wrong.

Are you sure this number is not growing over time?

Total Objects in Scene: 5345
Total Object Count: 10440```

Certainly. There’s nothing happening in the scene.

I am starting to think it’s a problem with Physics. I removed all the scripts leaving only rigidbodies and their respective colliders. The problem seems to trigger when I change the transform of the object. For instance, by moving the object manually through the scene, it triggers the problem. When it detects a collision, it seems to reset the problem. But when there’s no new collisions it keeps growing.

Maybe I should ask in the physics subforum.

1 Like