The question is answered, right answer was accepted
Removing Boxcollider from scene causes Lag
I have a problem:
I generate a 2D infinit map at runtime. This is separated in chunks and every cube in the Chunk gets a 2D Boxcollider. My Problem is that when i try do Destroy(GameObject Chunk)(not good i know) or set it to Chunk.SetActive(false) there is a lag spicke in the game. Yes i have a 100 by 100 Sprite Chunk, but testing revealed that when i remove all Colliders there is no lag spicke at all. I just have to add one and the same Problem occurs. Polygon Collider does the same.
I knew this are not much information. Unfortunately i don't have Premium so i cant Provide you with Profiler information sorry.
But maybe you can get me in the right direction.
Thank you for your help in Advance.
Unity 5 Personal has the Profiler. Have a look!
And yes, you should definitely be using object pooling for this (but you already know that)! I would recommend to forget about solving the current issue and put the time into setting up an object pooler ins$$anonymous$$d.
But it is a bit weird that adding only 1 collider causes the same lag spike. Look in the profiler for clues.
Thank you for you quick response!
It turns out I get a Lag spike when using all Collider in Physiks. But when i use just one my Code seems to be the Problem.
I am sorry for asking such a stupid question. I will mark this as Closed/Solved and eventually make a comment what went wrong in my Scripts so others make not the same mistake.
Thank you for your Help i realy appreciate it. $$anonymous$$eep it up.
It wasn't a stupid question, glad I could help :)
Follow this Question
Related Questions
Please Help. How to add score on collision mobile? 2 Answers
How to make font look sharp and smooth 1 Answer
OnTriggerEnter2D gets executed repeatedly by each collided object with the same Tag 3 Answers
2D Slide Animation 0 Answers
Differentiating similar components attached to a game object in script? 0 Answers