Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Generate collider for 2D mesh built at run time

Discussion in '2D' started by Zephni, Nov 9, 2015.

  1. Zephni

    Zephni

    Joined:
    Apr 23, 2015
    Posts:
    100
    I have been working on my own engine for building 2D levels. You pass it a List of tiles and a tileset and it builds meshes at run time with triangles supporting the tiles from the tileset.

    I am wondering if there is a way to wrap a 2D collider around the mesh contents. I found this topic:

    http://forum.unity3d.com/threads/solved-draw-polygon2d-collider-paths-around-a-2d-mesh.334039/

    In the final post a guy has kindly posted a "component" that you can attach to a mesh, and he says it should automatically do what I'm asking (after being attached to a mesh), but I can't get it to work.. and he even uploaded an example but after downloading that doesn't work either for me so I'm not sure if it's just not compatible with the latest version of unity.

    Has anyone got any ideas, or has stuff advanced by now and other options are available?
     
  2. Zephni

    Zephni

    Joined:
    Apr 23, 2015
    Posts:
    100
    Ah.. Ok I figured it out and now I'm embarrassed :p could a moderator delete this thread please?
     
  3. G4merSylver

    G4merSylver

    Joined:
    Apr 6, 2015
    Posts:
    2
    Could you bother explaining how you fixed this?