Search Unity

Deforming a 2D sprite

Discussion in '2D' started by Sejuru, Aug 12, 2019.

  1. Sejuru

    Sejuru

    Joined:
    Nov 26, 2018
    Posts:
    14
    Hi, I would like to know what is the best way that I can take an object and deform it to take the shape of another sprite during run time, like taking an apple and change its shape to look like a bottle after some seconds , just like in this picture. I was wondering if I could achieve this by using the new sprite shape package or the 2D animation.
    Deform.png
     
  2. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    You would achieve this magic through a sprite sheet. Create the images and the transition between each state.
     
  3. Sejuru

    Sejuru

    Joined:
    Nov 26, 2018
    Posts:
    14
    Yes, but my work team is looking to minimize the artwork, we need to find another method different to using a spritesheet :/ I'm looking to have some kind of script that takes two sprites and make one of them transform it's shape to match the other one
     
  4. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    I'm not aware of any code that morphs objects. You can try using trickery. Stretch the object, use a particle burst to hide the object and replace it with the final image. An illusion, of sorts. Another thought, stretch the apple to the hiegt and width of the apple juice, set the apple juice image to -1 in order of layer. Then reduce the alpha for the apple image until it fullly appears. I'd say use the trickery around 100 alpha. I'm sure you can manage to sell it. ;)
     
  5. Sejuru

    Sejuru

    Joined:
    Nov 26, 2018
    Posts:
    14
    Thanks! I combined a little bit of what you said with the new sprite shape package and it works now perfectly
     
    MisterSkitz likes this.
  6. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    I would love to see a video of the outcome :)