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 /
avatar image
0
Question by laurG · Jul 05, 2017 at 12:00 AM · physicscharactercontrolleroptimization

CharacterController Component does not use the Physics Engine?

Hi!

I was playing around with the physics and a CharacterController component.

I raised the TimeManager Fixed Timestamp to it's maximum value (10). And also modified the values in the Physics Manager to have as low impact as possible. In theory, by my understanding on how Physics work in Unity, the precision should be waaaaay off at the moment, but moving the CharacterController through the Move function results in great precision and great performance.

How is this possible?

Thank you!


EDIT:

After some research I found that:

Rigidbody:

  • Done in FixedUpdate()

  • Uses Unity's full physics system. It can be used with physics forces/impulses, etc.

  • Slides down hills however, since friction doesn't seem to do much.

  • It's best suited for objects but doesn't have much control for players.

  • Works with OnCollision events

CharacterController:

  • Done in Update()

  • Does NOT use any physics whatsoever, 100% player controlled.

  • The collider itself can not be rotated in any way. It is always vertical.

  • Collides against objects, ONLY in the direction it's currently moving. If it is moving forward, it will NOT collide with things that hit it's back or side. If it is not moving, it will NOT collide with anything. If it's collider passes through an object (such as the object moving through it) it wll NO LONGER collide with that object.

  • Does not work with OnCollision events. Only works with OnControllerColliderHit() against objects it's currently moving into. Not for anything that collides into it.

Credit: Juice Tin -> Source

In summary, if your gameplay is based only on your character's movement and your character's collision with other object (such as endless runners), it's best to use CharacterController because you will get rid of a lot of overhead from physics calculations while the collision detection has perfect precision.

Comment
Add comment · Show 1
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 bobisgod234 · Jul 05, 2017 at 01:49 AM 0
Share

Are you calling $$anonymous$$ove from within Update or FixedUpdate? CharacterController does not use a rigidbody (and as such, does not move along with other PhysX controlled rigidbodies), and will ins$$anonymous$$d move and perform custom collision checking whenever you call $$anonymous$$ove regardless of the Physics settings.

Try tossing a few rigidbody shapes around to verify that the Time$$anonymous$$anager settings are working on PhysX rigidbodies correctly.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by merkaba48 · Jul 05, 2017 at 03:34 AM

Perhaps because the CharacterController is kinematic? This means it's controlled via script and serves as an obstacle to non-kinematic physics bodies; changing the physics precision will probably affect how it interacts with dynamic physics objects, but as its movement is controlled entirely by script, it's unaffected by precision changes.

I don't know if that's true, but you can easily test it. Throw in a bunch of dynamic cubes and see how they behave with high precision vs low precision if you run into them.

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.

Follow this Question

Answers Answers and Comments

121 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 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

Voxel engine physics 3rd person character controller 1 Answer

Character Controller + Animation Not Working As It Should 0 Answers

Movement with AddForce: Wrong Direction 2 Answers

2D 360 degress platformer example needed 0 Answers

Character Controller falling through ALL mesh colliders. 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