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 adolphsen · Aug 07, 2019 at 06:33 PM · physics2dcollision detection2d-physicsplatform

"Ghost" collision in 2D physics game

I'm making a 2D game using the Physics 2D engine in Unity. The player does not control any character directly, but can change the direction of gravity to either up, down, left or right. Initial gravity direction is down.

In the attached example below the blue box standing on platform 1 is a Rigidbody2D of body type Dynamic and with Collision Detection set to Continuous, while all other objects in the scene are static BoxCollider2D platforms. When the player changes the gravity direction to right, I'd expect the blue box to fall all the way to the wall at the far right, but sometimes it happens that it bounces off the corner of platform 2 (the red circle). Platform 1 and 2 are of course exactly the same height and in the exact same Y position.

Can anyone provide any insight into why this is happening and what can be done to avoid this faulty collision detection? I've been playing around with all Physics 2D settings under Project Settings, but nothing seems to solve the issue. Also haven't been able to find similar questions with any solutions in the forum. Any help much appreciated!

alt text

ghost-collision-issue.png (6.8 kB)
Comment
Add comment · Show 3
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 TreyH · Aug 07, 2019 at 06:59 PM 0
Share

$$anonymous$$aybe a floating point issue, with your bottom side and that platform's surface using "the same" y-coordinate.


This also happens when folks use character controllers with box colliders, the corners get stuck on the ground for what I assume is the same reason. You could try replacing that single box collider with several stubby capsule colliders.

avatar image adolphsen TreyH · Aug 08, 2019 at 01:22 PM 0
Share

That's an interesting idea... I tried replacing the box collider with several capsule colliders, which then gives the square small rounded corners depending on the size of the capsule colliders. Unfortunately it doesn't remove the unwanted collection detection, it just makes the square bounce off the corner in a slightly different way because of the rounded corners.

avatar image unity_RdLfcwE4TdLgSA · Mar 29, 2020 at 10:35 PM 0
Share

bump, I'm having this same issue myself. I've looked around and it's suggested to use Edge Colliders 2d, but I'm using a tilemap 2d with a composite 2d. I'd like to keep using the composite 2d if I can get a work around for this issue,bump

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.

Follow this Question

Answers Answers and Comments

118 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 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

How to make a 2D physical movement like this ? 0 Answers

Where is mass center of Rigidbody2D placed? 1 Answer

Weird collision 2D problem? 0 Answers

Checking for Colliders with Physics2D.OverlapBoxAll Won't Work? 0 Answers

2D paper plane physics 0 Answers


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