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 thijsvandenhout · Mar 25, 2018 at 10:23 AM · collider2dboxcollider2drunner

Box Collider 2D colliding when not supposed to

Hi!
I am making a kind of 2D endless runner / infinite runner game and creating new platforms on the go (these platforms interact with the player with a boxCollider2D). These platforms are connected so they form one long platform. Although they are all on the same y-level, sometimes my player gets caught on the transition of one platform to the next (so on the side of the next platform), quite randomly. They align perfectly. Any tips on how to prevent this?

additional info: platforms are 1x25 meters long, a new one is created at the position.x of the previous one + 25, with equal position.y. The player runs with speed 10 meters/s

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
1
Best Answer

Answer by Geejayz · Mar 25, 2018 at 11:19 AM

Hi,

I had this same issue a few days ago. Although I had used the snapping tools and key 'V' to select the corner of a sprite so I could line it up with the one beside it, when I zoomed in really close there sometimes were slight differences in the height of the box colliders.

There are a number of ways to resolve it and you should look at the following links for more detail;

https://answers.unity.com/questions/1066094/sprite-with-box-collider-gets-stuck-on-nothing.html

...

http://forum.unity3d.com/threads/2d-jump-and-run.350872/#post-2272386

...

http://answers.unity3d.com/questions/607080/colliders-2d-apparently-touch-each-other-even-if-t.html

The simple option may be to make the collider on your moving character's feet be a circle collider and check the 'freeze rotation' check box in the constraints section of your character's rigidbody.

I resolved my issue by using the Edge Colliders on the floor pieces instead of the BoxColliders.

Hope that all makes sense.

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 thijsvandenhout · Mar 25, 2018 at 11:41 AM 0
Share

Thanks! the EdgeColliders worked (So far)

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

78 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

Related Questions

Turning off trigger with multiple box colliders? 0 Answers

How to move BoxCollider2D 1 Answer

How can I combine many BoxCollider2D into one Collider? 2 Answers

Collider2D Resize Based on Sprite Using Generics 1 Answer

Is it possible to have a class's variable correspond to either a BoxCollider2D or CapsuleCollider2D in order to reuse the class for objects with either type of collider? 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