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
2
Question by scottstephan · Jan 28, 2013 at 02:55 AM · rigidbodycharactercontroller

Difference between a rigidbody and a character controller?

Ostensibly I understand: A Rigidbody will be affected by physics and, by default, collisions with other rigidbodies.

A character controller is kind of a blank slate: Roll your own physics for this object, plus some nice functions (.isGrounded() etc.)

But when do you use each one? For example, in a current 2D project I have a characterController for my player character and use cc.Move() to get him around. Should I also use a cc for my enemies? Or are they better off being rigidbodies? Why?

Also, when moving a rigidbody, what's my best option? Translate seems wrong: Do you just add forces to the object instead?

I guess I'm just a little foggy and when you;d use each one and why, especially in relation to 2D games.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by whydoidoit · Jan 28, 2013 at 02:59 AM

You can use a CharacterController for anything that's supposed to be a character in the game (player or NPC_, it can work quite well. You'd use a rigidbody if you wanted Physics, you probably don't want physics for people who are standing upright - but it can be done!

CharacterControllers automatically handle lots of cool things like platforms and trying to "unstick" characters from each other - but it's a bit jerky. Personally I keep trying to use them, then write my own because it's not easy to get it to do exactly what I want, but if you are happy with the movement and it fits your style of game then go for it.

I'd only use physics if you need it (cars, rocks, balls etc etc).

Comment
Add comment · Show 3 · 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 scottstephan · Jan 28, 2013 at 03:02 AM 0
Share

As far as "write my own", you mean by attaching a box collider and going from there?

What's the best way to move a character in that situation? I understand Translate is not a good idea because you can move something inside another object.

avatar image whydoidoit · Jan 28, 2013 at 03:05 AM 0
Share

Yeah, in my current project I have a "kinematic" rigidbody so I can move the capsule collider at low cost. Then a $$anonymous$$eepApart manager that gently moves people out of the way of each other and important objects. A turning script which chooses a route around obstacles, a path follower that gives the route and scripts for animation based on movement.

avatar image whydoidoit · Jan 28, 2013 at 03:07 AM 0
Share

For instance I have a bunch of people queueing for things (like buses, honest) and a CharacterController would have them glitching all over the place because they need to be together. Plus I'm simulating people walking on a street where you don't often see people backing up 2 ft when then approach someone else, they kind of sidle around.

For me making a distinction between avoiding other characters (and pinch points) then having a separate major obstacle navigation that totally ignores people was a really good balance.

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

10 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

Related Questions

Can't use Rigidbody or Character Controller 0 Answers

Stop objects from going through each other with rigidbodies 1 Answer

How Character controller can push another character controller? 0 Answers

Question about pushing objects, "Animate Physics" and Rigidbodies 0 Answers

Which is more demanding on a computer, lots of CCcharacters or lots of Rigidcharacters? 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