Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Physics performance [ bug or not ?]

Discussion in 'Unity 5 Pre-order Beta' started by Sylmerria, Nov 8, 2014.

  1. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    I test performance of physics with new beta 12.
    My test is 500 ribigbody kinematic with sphere trigger collider and one child with a sphere trigger collider.
    Rigidbody can only detect child because of layer.

    So after the first frame, nobody moving. And physics continue to take huge time avr 8ms.



    So bug or normal ?

    And it's worse of course when I move all gameobject ( I use DOTween for moving GO)



    What do you think ?
     
    Roni92 likes this.
  2. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    What should move in your first test, if there are only kinematic rigidbodies and trigger collider? There is nothing physics should do in that case, kinematic rigidbodies are not affected by physics and trigger collider won't collide with anything, they are just "trigger", for example if you want to have a box as a room, to trigger a function when the camera enters the room.
     
  3. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    In my fist test, I move nothing at all.

    And trigger collide with rigidbody trigger, all my game works like that.

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using DG.Tweening;
    5.  
    6. public class fffffffff : MonoBehaviour
    7. {
    8.     public bool me;
    9.  
    10.     void Awake()
    11.     {
    12.         if (!init)
    13.         {
    14.             init = true;
    15.             for (int i = 0; i < 500; i++)
    16.             {
    17.                 Instantiate(gameObject, Random.insideUnitSphere * 60, Quaternion.identity);
    18.             }
    19.  
    20.             Destroy(gameObject);
    21.         }
    22.         else
    23.         {
    24. //desativate this line for desactivate movement
    25.             GetComponent<Rigidbody>().DOMove(Random.insideUnitSphere * 60, 15F, true).SetLoops(-1, LoopType.Yoyo).Play();
    26.         }
    27.  
    28.     }
    29.  
    30. //for force physics to call this
    31.     void OnTriggerEnter(Collider c)
    32.     {
    33.  
    34.     }
    35.  
    36.     void OnTriggerExit(Collider c)
    37.     {
    38.     }
    39.  
    40.  
    41.  
    42.     private static bool init = false;
    43. }
    44.  
     
  4. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    Yup, same problem here, would be nice if someone from physx developers commented this, because for looks like in some situations we have worse physx performance than in unity4. Anyone knows someone from nvidia physx? Because Im afraid Unity guys can't help us with this.
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Actually unity can and does help with this. Unity has a direct line to nvidia, and a direct contact with the engineers on physx, so they are by far the best people to contact with this issue, and Unity has even said they will do so if given the required data. Report a bug with this test.
     
  6. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    OK I will do. I was not sur that bug but if you confirme ...


    Edit: Done

    Case #646407
     
    Last edited: Nov 8, 2014
  7. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    News ( I can not edit my report bug ) : I have test in Unity 4.6 RC2 and I have not this problem so it's purely 5.0
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Ok thank you for your report, the team will look into it :)
     
  9. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    You can't edit the report, but you can reply to it to update it with more information.
     
  10. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    You really shouldn't post links to your FogBugz URL.
     
  11. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
  12. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Because links to all your other cases are at the bottom of that page, and someone can easily look there and if you have any links to source code or projects for repos they can download it.
     
    Roni92 likes this.
  13. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    oh, I see. Thanks
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Plus personal address in real life, phone numbers, credit card statements.

    Not really :)
     
    Roni92 likes this.