• 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 /
avatar image
0
Question by Wekthor · Jan 24, 2012 at 08:44 PM · collisioncollidercharactercontrollerperformance

Multiple Colliders Performance

Hi,

i have a Character controller on my GameObject. There is another primitive collider as child object on empty gameObject. This child collider serves as collision detection where i find out if other gameObject hits this GameObject.

Thing is, that if i use this child collider to detect collision wiht other objects with Character controller, the performance goes down like 10 fps on Iphone from 30 to 20. I realy dont know what is the issue. Since there is nothing unusual about the way i set up the colliders.

So what i was thinking is, if the issue can be the character controller capsule is intersecting with the child box colllider ? Or if this big fps drop can be caused by several colission detections when these objects are spawned ?

Also what would be the best solution for selective collisions. Lets say i would like to use these child colliders only to collide with one give object ? I know about the ignore collissions. But it didnt seem to work properly.

Thanks for any help.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by dannyskim · Jan 24, 2012 at 11:36 PM

Character Controllers by default are 4 to 8 times more expensive than a regular rigid body with a collider. This is a fairly wide known fact, and it's suggested to avoid Character Controllers as much as possible when deploying to mobile platforms. There is just a lot of default built-in overhead to Character Controllers that you most likely will not need.

Hard coding your own functions with a Capsule Collider that mimics the same functions as a Character Controller is much more efficient.

When you add a child collider to an object, it inherits the physics layer information from the parent, there is no way of going around this. So, because of this, no, your two colliders are not colliding with each other.

For selective collisions on the same moving body, it's easiest to create separate objects that are not in the same hierarchy, and have them just follow the position of the object that you're wanting to follow by script only, not by hierarchy. This may seem tedious, but you'll soon learn that everything about developing in Unity for mobile platforms is tedious.

Comment
Add comment · Show 1 · 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 Wekthor · Jan 25, 2012 at 02:15 AM 0
Share

thanks for the info on the performance of CCs. Its good to know, if there should be any additional slow downs in the game.

avatar image
0

Answer by Wekthor · Jan 25, 2012 at 02:24 AM

So the solution was quite simple. There was probably some overload on collisions when the GOs were spawning in between them, so i just turned off the collisions in collision matrix for everything except the one GO it should collide with.

Comment
Add comment · 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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Movement Collisions for Flat NPC with Character Controller 0 Answers

Making Colliders/Triggers or Rigidbodies move a Character Controller 5 Answers

Collisions between two CharacterController objects? 1 Answer

OnCollisionEnter does not work 4 Answers

How to deal the 2d platform physics? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges