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
0
Question by questJ · Aug 21, 2013 at 08:46 AM · collisiontriggercharactercontrollerboxcollidercollisiondetection

CharacterController with BoxCollider

Hello! So I'm using CharacterController for sprite movement and collision. I also attached child BoxColliders (set as Triggers) to detect collisions with various environmental triggers. I quickly realized that the BoxColliders were not registering collisions with anything in the scene. After banging my head for a bit I came to the conclusion that this was because their parent (CharacterController) is not under control of the regular physics engine; it seems like the equivalent of manipulating the BoxCollider's transform manually.

I'm wondering if there is a workaround for this or am I simply doing something wrong?? Any suggestions would be very much appreciated. Thanks!

EDIT: For clarification. I have a CharacterController gameobject. It has a child attached with a BoxCollider (IsTrigger set) and a simple script that prints when OnTriggerEnter. I move the CharacterController with Move. I also have a few separate gameobjects in the scene, each of which have a BoxCollider attached with IsTrigger set. The OnTrigger* events are not firing on the child of the controller when it passes through my scene triggers.

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 Eugenius · Aug 21, 2013 at 08:50 AM 0
Share

Could you provide a snippet of the script that isn't working?

From what I understand, you set Box Colliders on an Object with a Character Controller (which actually acts as the Collider for your Character).

To detect collisions of the character controller you need to use the OnControllerColliderHit(hit : ControllerColliderHit).

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by whydoidoit · Aug 21, 2013 at 09:15 AM

Something involved in a collision requires a rigidbody on it; it can be set to isKinematic = true so that it won't affect the standard processing of a CharacterController. The thing with the rigidbody gets the message - so you will get it on the child if the child has the rigidbody, otherwise on the parent.

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 questJ · Aug 21, 2013 at 09:26 AM 0
Share

Aww yes! Thank you, that did it. I felt like I was missing something there!

avatar image PEBKAC · Dec 26, 2013 at 03:39 PM 0
Share

Lifesaver, thanks.

avatar image cbrooks · Apr 22, 2015 at 06:25 PM 1
Share

This doesn't seem to be required in the current version (Unity 5). CharacterControllers do seem to register collisions with triggers now.

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

18 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

Related Questions

horse with rigid body and boxcollider wont collide with anything i tried mesh collider with and without convex , i tried box collider with and without rigid body. 2 Answers

Character Controller touching other objects 1 Answer

Trigger not detecting tag 1 Answer

how to disable characterController's collision detection 3 Answers

Im NOT Switching Scenes!! PLEASE HELP!! 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