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 DasDerDie · Aug 01, 2014 at 12:47 AM · rigidbody2dphysics2dboxcollider2d

How would I prevent ghost vertices?

My tile-based platformer has a box collider2d assigned to each tile. My character also has a box collider2d. My character occasionally gets stuck on the vertices of some tiles. These are called ghost vertices. How would I prevent this?

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 LeonardNS · Aug 08, 2014 at 08:16 PM 0
Share

You should specify more. $$anonymous$$aybe add some images or video.

avatar image astrein · Jun 26, 2016 at 04:35 PM 0
Share

Do you use physical movement or do you manipulate the transform. From my experience manipulating the transform works better when having problems with ghost Vertices.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Munchy2007 · Jun 26, 2016 at 07:23 PM

Using edge colliders instead of box colliders will solve the problem, this thread discusses it. http://forum.unity3d.com/threads/rigidbody-getting-stuck-on-tiled-wall.220861/

Comment
Add comment · Show 2 · 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 astrein · Jun 26, 2016 at 07:33 PM 0
Share

is there a solution for 3D games ?

avatar image Munchy2007 astrein · Jun 26, 2016 at 08:02 PM 0
Share

For 3D games I've always used a sphere or capsule collider on my character, and I don't encounter any problems with catching on the edges of the box colliders that make up the environment.

Whether there's any other approach that would help I'm not sure.

avatar image
0

Answer by Bunny83 · Jun 26, 2016 at 10:01 PM

Your question is a bit confusing. Using ghost vertices is a way to prevent unwanted collision response. Unity actually uses Box2d as 2d physics engine. However it's integrated into Unity and you can't use all features as if you would use Box2d directly. Box2d is written in C++ (just like the Unity core). So there's no way to directly use it from Unity's scripting environment (which is implemented with Mono). Inside Untiy you can only use what the Unity API provides.

So you can't implement ghost vertices in a Unity EdgeCollider2d since it can only represent a continous edge / series of points. It's not possible to specify additional vertices which are not used as edge but are taken into account for calculating the collision response.

Your only option is to "bevel" the corners of your colliders. So where two colliders meet each other you would add another 45° edge which might overlap with the other collider so the character can't hit a vertical edge which is the reason why an object get stuck..

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 Industrion · Sep 20, 2016 at 09:32 AM 0
Share

I'd be happy to deal with edge colliders entirely as I understand the issue (lack of knowledge of a selection of such adjacent colliders as a single entity), but I wish Unity's 2D physics system would do one of the following:

  • Provide an easy filtering/sorting mode for collisions (even controlled by a rect around a target, like the player) a bit like some games prioritising horizontal collisions over vertical. Prioritising Y-axis collisions deep within the collision engine is fine until you want to support a rotating world or to switch gravity direction to 1,0 or -1, 0.

  • Allow us to push new geometry into an edge collider, so we can temporarily join a moving platform to a connecting, parallel area of ground - even if this is computationally expensive. $$anonymous$$y use case is a simple (i.e. small-scale) platformer that occasionally involves an interesting physics shape, like a large windmill (making it difficult to use a simpler collision engine).

The point about moving platforms is my main issue, though.

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What's a good way at keeping a ball bounce around inside the scene? 1 Answer

Why does poligon collider 2d restricts movement of box collider? 0 Answers

Platformer2D Player sticks to platform corners 0 Answers

Ball bounces at different heights when it shouldn't 0 Answers

BoxCollider2D + Edge radius + use auto mass 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