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. Dismiss Notice

I want to make custom colliders on the fly... possible?

Discussion in 'Scripting' started by sp00ks222, Jun 7, 2012.

  1. sp00ks222

    sp00ks222

    Joined:
    May 12, 2011
    Posts:
    37
    I am working on a 2d game, and I find it would be a lot easier if I could make custom colliders/meshes on the fly (mostly just 2D boxes, but not perfect squares). There are most likely tools already for sale (I think I could just use a rage level tool, and then make the material invisible), but I am taking a "I want to learn how to do this" approach. I just know if this is possible, and if there is any further reading on this subject/tips?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,400
    You can construct meshes using the Mesh class and use those for convex mesh colliders.

    --Eric
     
  3. sp00ks222

    sp00ks222

    Joined:
    May 12, 2011
    Posts:
    37
    Awesome, i thought it would be something to do with that class. thanks!