Search Unity

Physics Problem

Discussion in 'Editor & General Support' started by adamus888, Feb 22, 2010.

  1. adamus888

    adamus888

    Joined:
    Sep 21, 2009
    Posts:
    29
    Hi!
    There's a bug in the project I'm currently working on:
    each time when I start the game, after a couple of minutes the game starts lagging extremely.....
    The profiler (see screenshot) says it's a problem with physics.....
    I have two levels. In both of them I use A* pathfinding (the first is on terrain and the second is on a navmesh) but I only get this glitch on the terrain level...
    Any help would be much appreciated....
    PS if you need more info, just ask....))))

    Screenshot:
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    is the terrain altered dynamically?
    also how is the pathing done on the terrain level, how are the data generated etc
     
  3. adamus888

    adamus888

    Joined:
    Sep 21, 2009
    Posts:
    29
    -no it's not altered dynamicly, but it's a procedurally generated terrain...
    -this is how it's generated:
    the pathfinder forms a grin on the terrain (screenshot)
    and finds the shortest route from a seeker (which has a character controller) to a target.



     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    the Seeker from A* path finding shouldn't cause physics trouble especially if you use the capsule one. Yet it naturally will cause the physics.simulate take quite a bit of time to do all the path finding as it physically moves around the capsule to see where it can pass

    did you check if the problem also exists on the built player?
     
  5. adamus888

    adamus888

    Joined:
    Sep 21, 2009
    Posts:
    29
    yes, the problem still occurs both on standalone windows and the web player....

    ps Thanks for your quick replies))))))
     
  6. adamus888

    adamus888

    Joined:
    Sep 21, 2009
    Posts:
    29
    ok, I have no idea what this means, but it works perfectly as long as seeker's on uneven terrain or flat navmesh but as soon as the seeker steps onto flat terrain, this bug appears.....
     
  7. adamus888

    adamus888

    Joined:
    Sep 21, 2009
    Posts:
    29
    the glitch has disappeared!!!
    all hail Unity that shalt be king hereafter!