• 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 Addy123 · Jan 10, 2017 at 09:34 AM · physicsrigidbody2dphysics2dcollision detectionboxcollider2d

Platformer2D Player sticks to platform corners

I am trying to create 2D platformer using Unity Physics2D, and I have this weird issue that occurs when the player jumps and in the air bumps along the wall. Instead of falling back down, he sticks to the edge, even though the player is clearly next to the platform as seen on the following picture.

alt text

I have observed the issue also when moving carefully to the edge, I can reach the same point. The raycasts that I am using to detect ground below don't detect any block, yet the player still doesn't fall down and stays in midair.

The player has Box Collider 2D and Rigidbody 2D (Dynamic) and the ground block has Box Collider 2D. I have added Physics Material with 0 friction to all of them but it didn't help at all.

Do you have any idea what causes this and how to resolve this? Is it an issue with Unity Physics? Is it even a good idea to use Unity Physics for 2D platformer or should I use only the collision detection and use my own physics controls?

Any insight is appreciated!

EDIT/UPDATE: After opening the project today in Unity, the problem with jumping along platforms is gone, so probably restarting Unity was a solution. However, it is still possible to get to the same position by movement along the platform. When the player jumps in this position he correctly drops all the way below the platform, but when he doesn't the block just levitates. Can this behavior be solved?

unity-issue.png (76.3 kB)
Comment
Add comment · Show 2
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 aditya007 · Jan 10, 2017 at 12:10 PM 0
Share

The collider could be of bigger size than the actual object?

avatar image Addy123 aditya007 · Jan 10, 2017 at 12:42 PM 0
Share

Unfortunately, the colliders of both objects are identical with their mesh, I have even tried making it smaller for the player but it didn't change anything. It might have something to do with the Rigidbody2D physics behavior, what do you think?

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

2D Physics Problem? 1 Answer

Why collision2d happend earlier in rigidboy2d? 2 Answers

About Rigidbody2D.AddForce's duration... 2 Answers

My player is unexplainably destroyed when collides with a collider 0 Answers

How much force does my 2d ball need to fly from point A to B ? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges