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 /
This question was closed Jun 15, 2013 at 02:20 PM by Eugenius for the following reason:

The question is answered, right answer was accepted

avatar image
1
Question by Eugenius · Jun 15, 2013 at 12:07 PM · collisionphysicscharactercontrollercolliders

Character controller not colliding with enabled box collider

Hello,

I've not been able yet to make this work so here it goes.

Is there any possibility to make a Character Controller Collider well collide with another object that has a Box Collider with IsTrigger enabled?

I've already tried creating children empty gameobjects and that doesn't fit the purpose of my problem right now.

My problem is really happening because I want my other GameObject to collide with a wall. Therefore I've enabled its trigger and added a rigidbody. Problem is now my AI won't make contact to it (just passes right through).

Any advice would be greatly appreciated.

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

  • Sort: 
avatar image
1
Best Answer

Answer by MSB · Jun 15, 2013 at 02:16 PM

The easiest way is to have 2 copies of the wall, first one is solid, the 2nd one is the trigger with the render turned off on it. So, duplicate your wall with its trigger, for example, call one "Wall" the other "Trigger" and put them in the same space. Ensure that "Trigger" has "istrigger" turned on and it's "mesh render" turned off. "Wall" has "istrigger" turned off and "mesh render" turned on (and a collider)

You then increase the size of "Trigger" a tiny bit to make sure the gameObject can make contact with it whilst it hits the rendered, psychical wall. Also you can drag "Trigger" onto "Wall" to make it a child and keep it organised.

Hopefully that makes sense!

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 MSB · Jun 15, 2013 at 01:34 PM 0
Share

Ah just noticed you said you had tried empty game objects. The moment you make something a trigger it will lose the psychical collider. This might be of use though http://www.unity3dstudent.com/2010/07/beginner-b01-basic-collision-detection/

avatar image MSB · Jun 15, 2013 at 02:16 PM 1
Share

(Sorry I'm typing all this on my phone, it's a bit slow)

If you try this

http://www.unity3dstudent.com/2010/07/beginner-b01-basic-collision-detection/

You can detect collision whilst keeping the colliders with them not being triggers.

avatar image Eugenius MSB · Jun 15, 2013 at 02:19 PM 0
Share

@$$anonymous$$SB marking as right question. It was my problem, I was simply said, scratching me left ear with my right hand...:) Thanks

avatar image
3

Answer by PAHeartBeat · Jun 15, 2013 at 12:25 PM

if you add Character controller component on you object, it's should not detect collison or trigger using OnCollisionEnter or OnTriggerEnter function, use

 void OnControllerColliderHit(ControllerColliderHit hit) {
 }

method instead.

Comment
Add comment · Show 4 · 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 Eugenius · Jun 15, 2013 at 12:28 PM 0
Share

I'm already doing that. $$anonymous$$y problem is only with the other gameobject (let's call it "cube"). So my Character Controller passes through my cube(which is trigger enabled) but collided perfectly with all other objects in the scene (which have the difference of not having their triggers enabled).

avatar image PAHeartBeat · Jun 15, 2013 at 12:49 PM 0
Share

No, When your cube collider or any other collider has IsTirgger enables, it's Pass through out the object, it will not stop when its collide with the object, if you want to stop your character when it's collide CUBE, you need to set Trigger disabled.

avatar image Eugenius · Jun 15, 2013 at 01:10 PM 0
Share

That's why I asked the question. I need that object to have the trigger enabled because its and instantiation and it will instantiate itself non-stop until it collides with something, if i would disable the trigger, then the item will continue to instantiate. The problem is a bit more complex I fear.

avatar image PAHeartBeat · Jun 15, 2013 at 01:16 PM 0
Share

I Think you use OnTriggerEnter() method for detection of collision, am I right?
if Yes just Use OnCollisionEnter() method and put trigges as disabled. Once it's get collision info in OnCollisionEnter() $$anonymous$$ethod you can stop instantiation for further.

I don't know exactly how and what purpose you use OnTriggerEnter() method. if you can share you small part of code so we will help you further solution.

Follow this Question

Answers Answers and Comments

16 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

Related Questions

CharacterController unexpected collisions with MeshCollider 0 Answers

More realistic physics? 0 Answers

Character controller partially passing through rigidbody in a head on collision 2 Answers

OnCollisionEnter not working with CharacterController 1 Answer

Colliders going through Colliders? 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