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 Bomadeno · Aug 10, 2012 at 05:30 PM · collidercharactercontroller

How to prevent the character controller sometimes passing through walls?

We have a character with movement, and it works nicely most of the time. It's made up of unity's CharacterController, our own input controller (in place of, for example, ThirdPersonController). This character happily moves around the level, and bumps into stuff and everything is apparently fine. Except...

Sometimes, the character slips through a collider. I can't narrow this down much, as it happens so rarely. I've never seen it happen:

  • Through terrain

  • Through horizontal colliders

I most often see it happen:

  • Through my "invisible walls" (box colliders surrounding the level)

  • When running nearly parallel to a wall

  • When jumping at a wall

  • Where there are multiple colliders in close proximity

I suspect it may be related to the speed the character is moving (but the speed should should never be fast enough to step right through the collider in a Move)

Any help on this will 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

· Add your reply
  • Sort: 
avatar image
0

Answer by Meltdown · Aug 10, 2012 at 05:47 PM

Try attaching this script to your gameObject that has the character collider.

Comment
Add comment · Show 6 · 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 Bomadeno · Aug 13, 2012 at 06:52 AM 0
Share

Hi Greg, thanks for the link. I just tried it - unfortunately I'm still slipping through things :(

Any other ideas? I'm considering "kill the player when they're somewhere they shouldn't be" but that could get increasingly messy.

avatar image Meltdown · Aug 13, 2012 at 06:57 AM 0
Share

You can try increase the scale of your scene and your colliders. You can also try adding another box collider or capsule collider to your character. Add it onto another gameObject on your character.

avatar image Bomadeno · Aug 13, 2012 at 07:04 AM 0
Share

Ok, I will try the other collider thing now.

Out of interest, what sort of scales might cause problems? At the moment the character is roughly 1 unit tall, should it be bigger/smaller?

avatar image Meltdown · Aug 13, 2012 at 07:06 AM 0
Share

Smaller scaled environments usually caused problems for me. But more for fast moving objects. You might want to make your characters about 3 or 4 units tall.

avatar image Bomadeno · Aug 13, 2012 at 07:07 AM 0
Share

No improvement when using another collider, still occasionally passing through

Show more comments
avatar image
0

Answer by linoB · Jun 01, 2014 at 05:31 AM

I encoutered the same situation this week and I think I've found the solution. I suppose that your charactercontroler center Z is not set to 0.

Mine was at .09 and I were able to go through most of my vertical collider when walking along and turning the camera.

After doing some tests, I found out that setting back the Z to 0 and now it doesn't happen.

So just set it back to 0 and this should go alright.

If my english is bad please excuse me, i'm french speaking , I hope this will help.

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Equivalent to Character Controller for Quadrupeds 3 Answers

How to make collision with moving CharacterController and moving Collider. 1 Answer

Character's trigger collides with itself 2 Answers

CharacterController had no enabled property 1 Answer

Character Controller colides while sliding 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