Search Unity

Question Need help creating a deforming sprite.

Discussion in '2D' started by S4MA3L, Aug 5, 2020.

  1. S4MA3L

    S4MA3L

    Joined:
    Apr 17, 2020
    Posts:
    38
    How can I made a 2d sprite deform when colliding with a 2d game object? It's for creating a jump pad type of thing. It's a mushroom sprite you can jump on. How can I do this? I want the mushroom sprite to squeeze as the player jumps on it and get back to normal shape in a natural way. Any help is appreciated.
     
  2. Kiesco91

    Kiesco91

    Joined:
    Aug 20, 2018
    Posts:
    80
    if you have access to a photo editor (photoshop - paid / GIMP - free) then you can create multiple images for your mushroom being deformed and then do this as animation. you would probably be best creating a spritesheet for this method though and then animating from that. lots of info for spitesheets on line
     
  3. S4MA3L

    S4MA3L

    Joined:
    Apr 17, 2020
    Posts:
    38
    Already thought of that, but just wanted to know if there was a better way to do it.. To make it look more natural.
     
  4. Derekloffin

    Derekloffin

    Joined:
    Mar 14, 2018
    Posts:
    322
    If all you're looking for is a very simple 1 dimensional shrink, you can mess with the scale of the object. So for instance you could have the height decrease with each impact. As it will do is internally resize the sprite just like a photo editor would, so not sure that is what you're looking for. If you're looking for something more dynamic like bending or the like, you'd probably want to go with the sprite being broken up into pieces and messing with each piece as you need to achieve the effect.