Search Unity

Performance Question about mesh colliders

Discussion in 'Getting Started' started by CyberInteractiveLLC, Mar 23, 2019.

  1. CyberInteractiveLLC

    CyberInteractiveLLC

    Joined:
    May 23, 2017
    Posts:
    307
    Hi, I have a scene where lets say there's 50 objects each of those objects have a mesh collider, but only 1 or 2 objects will be interacting with the player at one time, and so if i de-activate the mesh collider components for all remaining objects and only activate the one the player will be interacting with, will that improve performance? or does it not even matter at all?

    Edit: To keep it simple: would having many mesh colliders in your scene which are not interacted with affect performance?


    thank you
     
    Last edited: Mar 23, 2019
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    If those other objects are not moving, then they don't matter too much; the physics engine will put them to sleep and they cost little (and 50 isn't very many).

    If they are moving, then yeah, I think disabling the colliders might help... but 50 still isn't very many. I wouldn't worry about it unless profiling has shown you that this is a bottleneck in your app.
     
    Joe-Censored and Ryiah like this.