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 Zayin · Apr 08, 2015 at 01:15 PM · collisioncontroller

Character Controller Side Collision

I have a player+character controller colliding with a platform. I apply gravity through script when the controller is grounded. Unfortunately, this method fails when the character is standing on the side of a platform:

alt text

As you can see, the character appears to fly over the platform. This occurs because the character controller believes it is grounded. Is there an elegant way of solving this problem (perhaps one of the controller's parameters)? If not, what could I do?

Thank you!

ouch.png (143.6 kB)
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 SirBoboHobo · Apr 08, 2015 at 02:00 PM

you could adjust the collider of the platform and make it smaller, that way it'll look like the character is standing on the platform, like cut a bit off the edges, or instead of using capsule collider maybe try something more accurate, polygon or even edge collider with a little bit of work to adjust it properly. EDIT: you could add an empty game object to the character that is in it's shape, and check whenever the that gameobject collides add gravity to the character, use GetComponent to get the character's gravity, or this.gameObject.parent

Comment
Add comment · Show 1 · 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 Zayin · Apr 08, 2015 at 03:59 PM 0
Share

Thanks for your reply. I think that if I set the platform collider to be smaller, the character would be standing inside the platform at the edges (on the picture, you can see that the character is lower than the platform).

I think I could make it work by observing that OnControllerColliderHit has a collision point that is not underneath the character. In this case I would apply gravity. However, I would've thought that Unity had a built in way of fixing this problem... It seems pretty basic to me.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Player object: capsule with Character Controller goes through the floor randomly 0 Answers

Controller Collision Load Scene 2 Answers

3rd person controller camera passing through walls 0 Answers

Character controller fall through terrain 3 Answers

How can I have better physics interaction with a FPS Controller 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