Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by alirakiyan · Nov 30, 2013 at 08:59 AM · physicsperformancemanagement

Managing and optmizing too many colliding objects

hi I have a big city , with 100 cars. each car has 2-3 box collider and trigger. Car meshes are low poly. performance is low. Is there any optimization available?

Comment
Add comment · Show 5
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 whydoidoit · Nov 30, 2013 at 09:18 AM 0
Share

Firstly I'm guessing all of the cars that are moving have rigidbodies? Setting your physics collision layers may help (ignoring unused collisions). You could also try disabling physics for things outside the current view and/or reducing the number of colliders for distant objects.

What collision routines are you using (OnXXXXStay etc)

avatar image alirakiyan · Nov 30, 2013 at 10:17 AM 0
Share

Thanks. all of the cars , according to what Unity says about moving objects , have rigid body attached , and I use layer based collision detection. I use OnTriggerEnter only. I think physics should not be disabled for objects out of camera frustum , or far objects , because cars may go through each other , and when I approach them , it may cause problems.

avatar image chillersanim · Nov 30, 2013 at 11:30 AM 0
Share

First of all, is this lag also when you diseable the physics?
If not, then you search at the wrong point.
If yes, then you should use only one collider (full bounding box) the other colliders should be set to TriggerOnly. Then you should check how many colliders the other objects have (houses etc).
In GTA for example, cars which are far away gets they're collider diseabled, ins$$anonymous$$d, they just drive normal on the street (no collision at all).
Perhaps you should try that. ;)

avatar image alirakiyan · Nov 30, 2013 at 12:47 PM 0
Share

With no physics , FPS is much higher. I should check my colliders again. thanks for now.

avatar image whydoidoit · Dec 01, 2013 at 09:13 AM 0
Share

It's very common to "physicalise" objects within a certain radius of the player and allow standard AI logic to deal with situations beyond that.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by belvita · Dec 01, 2013 at 08:40 AM

Do not use mesh colliders if it is a serious mesh u got on ur cars the calculation takes time for unity instead delete mesh collider and add a box collider for ur cars and other objects

Comment
Add comment · Show 2 · Share
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 chillersanim · Dec 01, 2013 at 10:17 AM 0
Share

You are right, those mesh colliders are expensive, but...
As alirakiyan said:
"each car has 2-3 box collider".
There are no mesh colliders.

avatar image belvita · Dec 01, 2013 at 12:19 PM 0
Share

we need to see your code ,this problem may exist because of the way u design ur game.show some code please

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 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

Related Questions

Meshcollider count VS Meshcollider vertex count? 0 Answers

[C#] Game runs oddly slow 2 Answers

Rigidbody Overhead 1 Answer

does interpolation full up some kind of cache over time 1 Answer

2D physics performance on iPhone 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