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
4
Question by jc_lvngstn · Apr 04, 2010 at 09:24 PM · collisionrigidbodycharactercontroller

CharacterControllers don't register collisions with each other?

I've got a projectile that uses a charactercontroller, and an npc that uses one also.

For some reason, the OnControllerColliderHit registers when the projectile hits the terrain, but not the npc. I know the projectile is hitting the npc, because the projectiles visibly bump the npc.

This post discusses characters controllers and rigidbodies: http://answers.unity3d.com/questions/149/guidelines-for-using-rigidbody-collider-charactercontrollerscript-etc

But I'm still not "getting it", I'm afraid. A different post states that npcs should generally be used with CharacterControllers, but I seem to recall a different post stating that CharacterControllers don't work well together regarding collisions. So...I'm confused on what to use when. I understand triggers only work with rigidbodies. Should I have game objects with CharacterControllers AND rigidbodies? I guess I'm still confused about what type of controller/setup to use with various types of objects, and the caveats that go along with that regarding collision. For all I know, my projectiles should be rigidbodies, my npcs should be character controllers...in same cases. Anyone clear this up a little for me?

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

Answer by Eric5h5 · Apr 05, 2010 at 04:46 AM

You can always add another collider to the npcs, which the character controller will register collisions with in OnControllerColliderHit.

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 thundercat · Dec 04, 2010 at 10:09 AM 0
Share

Rather than messing about with different FPS controllers like the RigidbodyFPSWalker mentioned by dhendrix, for basic collision detection where you're already using FPS controllers, the addition of a basic collider is the easiest solution.

avatar image Bovine · Nov 25, 2012 at 07:04 PM 0
Share

So if I have CharacterControllers colliding in my game, there's no callback to say the two things collided?

Basically I want a controller so that my NPCs don't walk through each other, but I want to be able to detect a hit and take action accordingly.

avatar image clunk47 · Oct 17, 2013 at 05:58 PM 0
Share

How in the world are both of the answers on this page marked as accepted?

avatar image
0
Best Answer

Answer by dhendrix · Apr 05, 2010 at 03:43 AM

This is my personal opinion, but if you want to detect collision between multiple CharacterControllers, then personally I would say to ditch them and use this instead:

RigidbodyFPSWalker

Despite the name(FPS), its great a base for any kind of character, and provides fluid movement with rigidbodies. But no there isn't any easy way to detect collision between CharacterControllers, which is why I tend to avoid them. Hope this helps you.

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 jc_lvngstn · Apr 05, 2010 at 11:25 PM 0
Share

So in general, should I just use ridigbodies for anything that moves, such as npcs or projectiles?

avatar image dhendrix · Apr 05, 2010 at 11:30 PM 0
Share

In most cases I would, though if your projectiles are really fast you may want to do a Raycast to detect a collision and just use a bullet for visual aid only.

Really you should use whatever components you need to easily detect collisions between desired objects.

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

Is there a rigidbody character controller 3rd person that can handel stairs (steps)? 1 Answer

Two Character Controllers Colliding... 0 Answers

Any way to ignore collision between rigidbodies and colliders/character controllers? 1 Answer

Collision between CharacterControllers 1 Answer

Can't use Rigidbody or Character Controller 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