- Home /
Physics calculates collisions between disabled layers
Hi!
My setup: 1000 sphere colliders set to trigger all in one place and on physic layer A. capsule collider (player), that have child capsule colldier that have capsule colldier ... chain has 9 Gameobjects on physic layer B. They are not trigger and in root is Rigidbody with use gravity set to false (rest are default) A only interacts with B. B only interacts with A.
Scenarios 1: If i hit play and will start to rotate player, profiles shows 0.7[ms] in physics.
Scenario 2: If i set off all the sphere colliders, hit play and rotate player, profiler shows 0.16[ms]
Scenario 3: If i will turn on all the sphere back again but change layer for all player GameObjects to A, hit play and start rotate player, profiler shows 0.44[ms].
Scenario 4: if i will disable player and nothing moves profiler shows 0.1[ms]
Questions: Why in scenario 3 time is greater than in scenario 4 + scenario 2? The difference between what i think and what i get is 0.44 - (0.16 + 0.1) = 0.18[ms]. Is physics engine do something against those spheres and capsules from the player even they are on the same layer? Can i somehow decrease that? I Ask these questions because in my project i get additional 2[ms] because of apparently some calculations between layers, that are set off in collision layer matrix (events OnTriggerEnter etc. are not called so i have everything set properly). Thanks and sorry for bad english ;p