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 Mr.Hal · Apr 28, 2014 at 10:10 AM · collider2dboxcollider2dedge detectionpolygoncollider2d

Tile Generation with collider2D's

I would like to make a bunch of Tiles(on a platformer). However my efforts to make a working collider are manual and thats a hindrance to my workflow and it will ruin the way the game works to some degree(in script and gameplay)... I wanted to know if there was a way to make tile colliders effectively... in script... without the catching corner glitch that Box2D has.

I have 3 choice from what I deducted by myself but they are all pretty bad unless somebody can help me fix them.

  1. Use a bunch of BoxColliders on one game obj... Con; The Corner catching glitch. Possible fix; Make the BoxCollider big enough for more tiles.

  2. Edge Colliders, Using a bunch with a concave edge center where the player will reside. Con; I have no way to figure out the exo and interior of the edge donut that would be a room inside a script. Possible fix; No possible fix without somebody actually having a idea where to start first.

  3. Similar to BoxCollider but with PolyColliders... No Con;No glitch... Same Possible Fix. But I have no idea on how to tackle that like the Edge Collider because complications of actually approximating a shape inside and out easily and accurately.

What the unity team could do... Actually have a function to deduct shape or merge a bunch of shapes into one PolygonCollider2D/EdgeCollider2D.

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 Tarlius · Apr 28, 2014 at 11:43 AM 0
Share

What is the "corner catching glitch" you are talking about?

As for collider generation, I solved a similar problem by generating a grayscale texture and applying it to a sprite set to not display with a polygon collider on it. Seems the collider shape changes when you set the sprite texture, maybe that would work for you?

Depending on the size of the levels/etc, you could also get the artist to output a grayscale texture.

avatar image Mr.Hal · Apr 29, 2014 at 12:48 AM 0
Share

In Box2D for C++, they had a glitch where if you had a "BoxShape" for each tile in a game. The Top corners would catch on the players feet corners(Unless it was a CircleShape in which case the player would be lurched into the air as if he went off a ramp), But it was random and there was really no nice way to fix it with out changing either the level or the player and entities... Something that "would" only be trivial and easy to solve in Unity.

There is a way to make Unity use grayscale textures for collision in script? because I would be really invested in that feature. And to be square... I'm not using the sprite renderer for various reasons... lighting, shadows, normal maps, and other Advanced 3D stuff... But that's for the world... I'm still using the Sprite Renderer for the player and other stuff.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Mr.Hal · May 10, 2014 at 12:01 AM

I had to suck it up and use box colliders for every tile, Later on though I'm going to fix this with neighbor checks and stretch the size of the colliders to reduce the amount, Because right now there is too many box colliders but it works fine anyway, I think the unity team may have fixed the glitch, but I do hit phantom bumps when sliding on circles, I compensated with a harsher gravity to reduce the appearances of the bumps. All is well.

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

21 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

Related Questions

Force PolygonCollider2D into a Square or Autofit BoxCollider2D 0 Answers

World Coordinates of BoxCollider2D ? 1 Answer

EdgeCollider2D or BoxCollider2D? 1 Answer

child's 2D box collider not following Game Object 0 Answers

Rotating Box Collider 2D independent of its gameObject [v4.7.2f1] 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