Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Is transforming static colliders really damage performance? with test

Discussion in 'Physics' started by the_nt, Jul 30, 2016.

  1. the_nt

    the_nt

    Joined:
    Jul 29, 2016
    Posts:
    2
    Hi!
    I'm a newcomer to Unity and I just finished the Roll-a-ball tutorial.
    But the concept "transforming static colliders cause performance loss" still confuses me.
    I've checked the doc, which says:
    But in this little HelloWorld, I can feel that Static Colliders are faster than Dynamic Colliders.
    That's against what I've learned. So I made a small test (not so small for my machine :) )
    Put 23,104 Pick-Ups (rotating cubes) in the scene, with Rigidbody, play, and use the built-in Profiler to watch performance status. Then without rigidbody.
    I tested it twice, results are preferring Static Colliders:

    test1-with-rigidbody.jpg

    test1-without-rigidbody.jpg

    test2.png

    The diffrence in Physics Time is quite obvious. And fps differs too (~2fps vs ~3.5fps).

    I also tested moving cubes, results are same (and both more laggy :p ).

    My Guess & Questions:
    A. The new version of Unity(5.3.5) have already did some optimization on this issue. So when you don't need physics, just don't use Rigidbody?
    B. Maybe it's just because my PC's graphic card have somehow accelerated it (PhysX)?

    How's transforming static/dynamic colliders works for your project's performance?
    Looking forward to answers. Thanks in advance!
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,936
    the_nt likes this.
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    4.x has different rules than 5.x. Roll a ball is a 4.x tutorial. 5.x removes penalty for transforming a collider.

    Anyway premature optimisation.
     
    the_nt likes this.
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,936
    I guess the real issue here is that the docs need some updating.
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It would be odd tbh. Also "feel"? use profiler! no need to guess.
     
  6. the_nt

    the_nt

    Joined:
    Jul 29, 2016
    Posts:
    2
    Thanks AcidArrow! Thanks hippocoder! It's amazing how soon you have replied! Good answers, really help!
     
    Last edited: Jul 30, 2016
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    NP - you put effort into your post so people should take effort to reply and assist you.
     
    MoonJellyGames likes this.
  8. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,418