Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
This question was closed Oct 26, 2016 at 09:54 PM by Genei_180 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Genei_180 · Oct 26, 2016 at 08:52 PM · 2d game

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.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image conman79 · Oct 26, 2016 at 09:01 PM 1
Share

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.

avatar image Genei_180 conman79 · Oct 26, 2016 at 09:35 PM 1
Share

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.

avatar image conman79 Genei_180 · Oct 26, 2016 at 10:20 PM 1
Share

It wasn't a stupid question, glad I could help :)

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

80 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges