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 CelloCoder · Jul 02, 2015 at 08:34 PM · c#2d2d-physics

2D Geometry Dash Clone Player Stuck Between Tiles

I was playing Geometry Dash one day and thought, "Hey, this should be easy to make in Unity!" so I got to work. After a good bit of work, I have something playable going, but I have noticed that my player can sometimes get stuck between two tiles that make a flat surface. (Yes, I am using the slippery physics material but it still gets caught.) I tried changing the BoxCollider2D to a CircleCollider2D, and it fixed that problem, but sometimes the CircleCollider2D would slow down slightly when it landed from a jump, even though I put the slippery material into the new collider.

I need it to not get caught between tiles with a box collider, or I need it to keep its horizontal velocity on a flat surface or when hitting the ground after a jump with a circle collider.

What should I do to fix this? Is this possibly a glitch in Unity that cannot be avoided (If so, what kind of workarounds can I use?)?

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 MelvMay · Apr 13, 2016 at 07:29 AM

This is just an artifact of how Box2D works and TBH how most physics engines work. It calculates collisions for each collider separately. A good write-up of it can be found here.

The EdgeCollider2D is designed to resolve this problem by allowing you to create a continuous surface of edges which won't have this problem. That is also much more efficient than adding lots of box colliders.

Finally, I'm working on a CompositeCollider2D in Unity that allows blending of multiple collider shapes which will also stop this issue. You can see more info on this on my Twitter feed.

https://twitter.com/melvmay/status/715165831680884736

https://twitter.com/melvmay/status/715536626231980032

https://twitter.com/melvmay/status/718827746042974210

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

23 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

Related Questions

Collider just for Tag (2D) (C#) 1 Answer

Problem with disabled collision in 2D objects 0 Answers

How to check if my enemy hits the ground at a certain velocity then add explosive force. 1 Answer

How to check if an object hits the ground hard enough then add explosive force around it (2D) 1 Answer

Jumping from special jump orb 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