Search Unity

Smart positioning of items.

Discussion in 'Scripting' started by McGravity, Jan 26, 2016.

  1. McGravity

    McGravity

    Joined:
    Nov 2, 2013
    Posts:
    60
    Hey,

    I'm looking for a smart way to position lots of items.

    At the moment they have Vector3 attributes for "inHandCarrying", "inHandUsing", "inBackSlot" etc..
    This is a little annyoing as we always need more. For example the "BackSlot" is for carrying an item on the back, but when you can have them diagonally like an X we'd need two "inBackSlot" positions and so on.

    Of course there are quite different items like an hatched and a saw. They're held and used different. My first idea was to position them in the 3D modelling tool to fit the hands. But then we would still need lots of positions for all kind of inventory slots.

    greetings
     
  2. Boz0r

    Boz0r

    Joined:
    Feb 27, 2014
    Posts:
    419
    I don't see how this could be possible. The positions seem intuitive to people, but can you describe them mathematically?
     
  3. McGravity

    McGravity

    Joined:
    Nov 2, 2013
    Posts:
    60
    Mathematically would be smart, but as you say probably almost impossible.

    I just thought there might a neat trick I don't know of, to minimize the effort.

    (A better solution for example would be to group the items in very similiar positions (Hatchet, Pickaxe, TwoHandSword), (Torch, OneHandSword, Spear).)
     
    Last edited: Jan 26, 2016
  4. Boz0r

    Boz0r

    Joined:
    Feb 27, 2014
    Posts:
    419
    I've never used the modeling tool, but I'd put empty objects in the hands of the character, and on the back, and use them as stand-ins for the weapons. Then you always know where to position the weapons on the character, and you can just have different animations per weapon type. But I don't know if that's how you already did it.
     
  5. McGravity

    McGravity

    Joined:
    Nov 2, 2013
    Posts:
    60
    Yeah, that's how I do it. Only that the items still need a local position within the empties.

    With modelling tool I meant some arbitrary tool like Blender.