Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Profiler shows massive spikes in active constraints

Discussion in 'Physics' started by kstothert, Nov 7, 2018.

  1. kstothert

    kstothert

    Joined:
    Dec 8, 2016
    Posts:
    45
    here is a screenshot of the profiler

    Screen Shot 2018-11-07 at 2.26.26 PM.png
    most frames are steady at around 5k active constraints but this spikes to almost a million at it's worst.

    Where might i find the cause of this spike?
     
    DavidSWu likes this.
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,084
    Constrains of what?
     
  3. kstothert

    kstothert

    Joined:
    Dec 8, 2016
    Posts:
    45
    thats my question, how do i find the cause of all these constraints
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,084
    Disable some objects, observe profiler and try find which one(s) is/are cause.
     
  5. DavidSWu

    DavidSWu

    Joined:
    Jun 20, 2016
    Posts:
    73
    I am seeing the same thing, but I am getting up to 105k constraints. I will attempt to isolate it, but it would be helpful if there were a way to discover what kind of constraints we are talking about.
    We have a voxel based game and there are about 60k voxels in the scene that I am testing with (damn UGC).
    However, 95% of them are static and without rigid bodies.
    We have less than 20 contacts most of the time.
    Oddly it is 0 for a period and jumps up to 105k for a few frames, then falls back to 0 and the cycle repeats.

    upload_2019-2-26_1-47-30.png
     
  6. epicproblem

    epicproblem

    Joined:
    Jul 28, 2016
    Posts:
    4
    I'm having the same issue and a lot of difficulty isolating, so far no luck.
     
  7. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    9
    hi, I am looking at similar behaviour in the profiler however I know what is causing it in my case (suggestions on how to fix welcome). Essentially I am instantiating a destructing object (a rock) which is composed of ~20 subobjects partially into a terrain. They explode nicely but the physics simulation eats GPU before stabilising. Moving the object slightly so it does not intersects the terrain fixes the problem. I will probably try carving a "crater" in the terrain as I need to do that anyway..
     
  8. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    9
    FYI in case anyone is interested carving out a section of the terrain to reduce the overlap fixed the problem for me, and I needed a crater anyway :)