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 Sannerex · Mar 29, 2017 at 08:38 PM · collisioncollidercharactercontroller

When using a character controller for the player, can other colliders be used alongside the character controller?

An example of what I mean can be found in shooter games, where the player could have a collider for the head, arms, legs, and/or torso. If the player is hit on the head collider, they may take double damage.

What I currently understand about the character controller is that you use the charactercontroller.move function to move the player and have them collide with other objects. So what I want to learn is if other colliders can be used alongside or in tandem of the character controller? How do I prevent these "extra" colliders from colliding with the wrong thing? (For clarity, if a projectile, like an arrow, was to hit the player, I would want the arrow to only be able to hit the extra colliders, like a collider set for the head or torso, and not the character controller collider or the collider used for the character controller.) How do I accomplish this?

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 dvandamme · Mar 30, 2017 at 12:20 AM

lots of different ways for that, heres 2

make capsule collider that the character uses small, - like a disk on the ground, then you'll get your basic locomotion stuff from that, then put more colliders where you want them and have each set up in a central controller which allows calculation of the damage to different parts.

so a custom controller has a 'leftArm, rightArm, Head, Torso, leftLeg, rightLeg as a bunch of inputs for damage, and if a collider hit is triggered on any of those colliders, they tell the custom controller, it calcs the damage.

another option is to use layer masks to have one big collider for the entire character, but that is ignore by all ray casting from weapon objects (or just layer test in every collision test). you still want the big collider to register interaction with other physical objects, so that will give you a useful play envelope. Then, like before, you have a lot of little colliders on other parts of the body, and they are on a 'hittable' layer mask for weapon objects. Again, you have a central controller that takes hit information and calculates that based on what was hit. you could have things like sand to the face does blinding damage, but sand to the leftLeg is ignored. but a lazer to anything is burning damage etc... layer masking could allow some very interesting layed effects (pun intended :D)

https://docs.unity3d.com/Manual/class-TagManager.html

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

110 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

Related Questions

Problem with rigidbodys and box collider 1 Answer

Character Controller Child Collisions 2 Answers

OnCollisionEnter does not work 4 Answers

Getting Character controller to fit model? 0 Answers

Character Collider doesn't collide with other Colliders 2 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