Search Unity

  1. We want you to join us at GDC this year! Take a peek at all of the events we will be hosting during the week of GDC.
    Dismiss Notice
  2. Tell us about your experience here and you’ll get early access to the 2018 Game Studios report + more goodies.
    Dismiss Notice
  3. Unity 2017.3 has arrived! Read about it here.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  5. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice

How do you guys deal with weapons / items that have different positions?

Discussion in 'Game Design' started by Maximilious, Feb 13, 2018 at 6:49 AM.

  1. Maximilious

    Maximilious

    Joined:
    Nov 29, 2016
    Posts:
    12
    For example.

    Say I purchase a new weapon pack asset from the store, I put them to my item system where I have LeftEquipSlot, RightEquipSlot, LeftBackEquipSlot, etc... these are attached to the player model from the class I created in runtime.

    All the weapon prefabs from the asset store I purchased in the first instance works, awesome!

    Then I buy another weapon pack from another creator, but this time my weapons are all over the place, or rather they all follow the same pattern of being Y rotated 90 or 180 degrees, etc...

    I mean, I can probably hardcode an offset for weapons that do not match the same prefab as the ones I built it from, but there has to be an easier way of dealing with multiple prefabs from multiple creators for weapons.

    Thanks in advance
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    6,067
    Just fix them. That is, drag one of your new weapons into the scene, do "Break Prefab Instance" on it, position and rotate it to the way you want your weapons positioned and rotated, and then make a prefab out of it.

    There's absolutely no rule that says you have to use the prefabs that come with the pack, exactly as they are.
     
    Ryiah and theANMATOR2b like this.
  3. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    545
    I am not sure this solution would be any faster than what @JoeStrout said, but for me I think it would be.

    I'd import all of the trouble models into my 3d app -- maya in this case -- select them all, set absolute transform to 0,0,0. If they need rotated, that is quick and easy to. Then, freeze transformations, and export. When they come into Unity, they will be at the origin, and you can have them facing the z direction or whatever you chose.

    That would be the fastest way I can think of.

    Side note: I recently submitted my first model package to the Unity store, and among many quality control restrictions, one of the things they require is that your asset be centered at the origin.

    Are you buying these from Unity asset store?
     
  4. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    559
    only putting the weapons to 0,0,0 will not be enough, since all weapons have different size.

    what I did in my WeaponPickup system that I put a transform under the right hand, gave them the weapon's name and positioned and rotated it so they are placed right.
    and then only when picking the weapon up, they just need to be parented under that transform.