Search Unity

Attachment Points

Discussion in 'Scripting' started by jmcclure, Oct 24, 2011.

  1. jmcclure

    jmcclure

    Joined:
    May 5, 2009
    Posts:
    48
    I'm interested in hearing how other people have implemented "attachment points" into their art asset pipeline. I receive art assets from artists and I need a reliable way to have them represent places in the geometry where other game objects will be attached.

    Take for example a space ship model. How could an artist best set an attachment point such that a unity script could quickly look it up and determine the transform (position and orientation) on the model for gun turrets, thrusters, or other interactive parts? Do people normally just use unattached bones with special labels that aren't influenced by any animations?

    I'd really like to hear thoughts and suggestions.
     
  2. profanicus

    profanicus

    Joined:
    Nov 23, 2009
    Posts:
    295
    In Maya I would use Locators, they import in to Unity as empty game objects.
     
  3. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    A really wonderful method is to create a set of objects and have them handy. Lets say you want guns. You have your artist create say 10 guns that will be placed on ships. These guns are either single or multi piece, they can each have special effects and movements.

    The next key is to take each of these guns and convert them back to a single mesh and export them to an Obj or 3ds or whatever file that is common for the app they are running in, and place them on the model in all the places that they could be. They will then be named in the 3d app so that they are recognizable by the programmers. This allows the artist to "see" where the gun point is and lets them focus on art rather than where things are rotated and how they sit on the ship.

    Now, in Unity, you get the ship with all the "hard points" as models of a gun. These models are then stripped of the MeshFilter and MeshRenderer and are applied to the scripting as whatever they should be. Now, all you have to do is select a weapon, post it at the hardpoint and parent it to the hardpoint.

    What this means is that any moving ship part can be designed by an artist, move as the artist wishes and the hardpoint and gun that is attached in the game can also move with the segment that the artist wished.