Massive slowdown due to physics2D.FindNewContacts
I am making an Asteroid-like game on unity. In the game, you need to evade the upcoming asteroids. The asteroids are created, move through the screen and then are destroyed. All of the objects in my games are dynamic (asteroids can collide with other asteroids and change their velocity and rotation). The game for some reason experiences massive slowdowns and after checking the profiler this is due to the physics engine. In some cases physics2D.FindNewContacts can take up to 40ms in a frame. I also want to note that the asteroids are clones of a prefab asteroid and that I use clones of sprite objects for the background.
I don't really know how I can make things perform better... I want the asteroids to be dynamic.
Image of the game: (The stars are sprites because they flicker every once in a while)
Answer by Nimi142 · Oct 04, 2019 at 08:38 PM
Nevermind the problem was that I used Polygon Colliders for round objects and it killed the physics engine.
Your answer
Follow this Question
Related Questions
No physics object gravity-driven movement? 0 Answers
Is calling OnCollisionEnter2D on allot of GameObjects leading to worse performance? 0 Answers
Removing a script if its only use is the Start function 1 Answer
Performance Problem: Unaccounted time between: LateBehaviourUpdate and CanvasRenderer.SyncTransform 2 Answers
Set Anti-Aliasing as PostEffect or inside QualitySettings or both? performance? 0 Answers