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 /
avatar image
1
Question by Rei · Apr 11, 2011 at 08:59 AM · rigidbodycharactercontrollerkinematic

Should a Character Controller attach with Rigidbody?

http://unity3d.com/support/documentation/Manual/Physics.html

somewhere in the reference it says: "You should never move a Static Collider on a frame by frame basis. Moving Static Colliders will cause an internal recomputation in PhysX that is quite expensive and which will result in a big drop in performance. On top of that the behaviour of waking up other Rigidbodies based on a Static Collider is undefined, and moving Static Colliders will not apply friction to Rigidbodies that touch it. Instead, Colliders that move should always be Kinematic Rigidbodies."

A character controller is derived from a collider, So is that mean I should always attach a kinematic rigidbody to the character controller?

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
3
Best Answer

Answer by Skjalg · Apr 11, 2011 at 09:09 AM

Yes.

If you intend to move the collider around a lot it is recommended to also attach a kinematic rigidbody to it.

http://unity3d.com/support/documentation/ScriptReference/Collider.html

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 Rei · Apr 14, 2011 at 09:23 AM 0
Share

well as it's the collider for player object, it is going to move around. It wasn't that obvious that we should add a kinematic rigidbody to it. I'm glad to get a confirmation from you experts. : )

avatar image ZOwlz · Feb 17, 2013 at 06:39 AM 0
Share

The document should have explained it more that it will cause performance issue otherwise.

avatar image
1

Answer by djee · Feb 08, 2014 at 03:00 AM

I tend to disagree and say "No".

The character controller (CC) - at least as implemented in PhysX, that is a kinematic CC - is a very specific piece of code working alongside (but outside of) the main physics simulation (rigid body dynamics). Although the CC do use a capsule collider, the collision is typically performed "by hand" in the CC code rather than automatically through the physics simulation like other colliders.

The remark about a kinematic rigid body being needed with a collider when you move the collider (i.e. change the transform directly, instead of applying forces to a rigid body) is mainly directed at other objects like a moving platform you would have in a typical platformer game. Indeed in this case the collider is by default part of the single "static" rigid body implicitly created by Unity to model all static objects in the simulation. So if you move it you invalidate the collision cache of all those objects at once, hence the performance warning. But in the case of the CC the collider is not part of the simulation, and is merely used as a data structure to remember the shape of the collision the CC has to take into account into its own specific collision routine.

I may be wrong about all this, as I am quite new to Unity. However I do know well about physics engines in general, and have written my own CC and physics engine, as long as studied the code of Bullet Physics (another physics engine competing with PhysX) and the CC of Doom3. If anybody has more insight about the actual Unity implementation please feel free to correct me.

For more informations about character controllers you might want to read the CC notes in the PhysX SDK or have a look at an actual working implementation in the Doom3 GPL code.

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 Slight0 · Aug 08, 2015 at 04:23 PM 0
Share

I am somewhat familiar with bullet physics as well (implemented it in my unity engine for threading reasons) and, now that I'm using the new PhysX, am wondering the same thing.

The real question is whether Unity uses PhysX's character collider or if it implements it's own which uses a standard capsule collider. This really should be explicitly stated somewhere.

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

2 People are following this question.

avatar image avatar image

Related Questions

Character Controller Jittering 0 Answers

Moving a player on a rigidbody platform that can collide 2 Answers

How to make a ragdoll not rotate but still be non kinematic? 0 Answers

jet pack physics with character controller 1 Answer

How to use character controller to push down hinge joint properly 1 Answer


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