Search Unity

Solving game design problem, spritesheets and swapping sprites

Discussion in '2D' started by URekt, Jun 24, 2019.

  1. URekt

    URekt

    Joined:
    May 2, 2017
    Posts:
    5
    Hello all,

    Let say you have a 2d game where characters could have tons of different weapon or clothing that could be shared on multiple characters and you are using sprite sheets, what would be the best way to implement this?

    Ideally I could have a base animation such as 'handgun-idle, handgun-run' etc and you could swap out the base characters handgun and clothes. Then the artist can just make handguns that conform to a certain size etc.

    I realise tools like Spine exist but I'm hoping to use a Unity led solution.

    Thanks
    Nick
     
  2. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    You will in some way have to author a skeleton of gameobjects (Anima2D, Spine, etc) and animate them along with your character. Then you can add new child gameobjects to the points.

    For instance, you would animate an object that follows the hand properly (or the sprite follows the bone if you're using a skeletal animation package), and then make a handgun sprite the child of it. Then you can swap out that sprite or that child object to change guns.

    https://blogs.unity3d.com/2018/11/09/getting-started-with-unitys-2d-animation-package/