- Home /
How to optimize a lot of colliders?
Hello everyone, so I have a lot of enemies in my 2D game, each with their own collider. My problem appears when they gather in large groups and move, the Physics2D.Simulate in the profiler goes trough the roof. So my question is: is there anything I can do so i can have a smoother performance with this many colliders coliding with each other at once?
Photo for context: https://www.dropbox.com/s/tyx26ey1oi7smkm/Colliders-min.png?dl=0
Answer by ocni · Apr 08 at 03:35 PM
I managed to fix the problem by giving a 0 friction physics material to the collider and rigidbody of the enemies. Now it doesnt tank performance as much.
Interesting. What kind of collider are you using? In case you currently have box colliders try changing them for a circle collider. According to the documentation this is easier on performance than boxes.
Your answer
Follow this Question
Related Questions
Why do two colliders cross at high force? 0 Answers
How to set collision for an object with specific collider size? 3 Answers
Unity 2D Collider did not create any collision shapes as they all failed verification 0 Answers
Ghost collisions problem: RigidBody player bounces, when moving on platform edges 2 Answers
How to check if a polygon fits in specific 2D spot? 0 Answers