Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Elastically Jiggle a 2D Image

Discussion in 'Getting Started' started by civmi, Nov 5, 2023.

  1. civmi


    Jul 28, 2023
    I have created a system in RPGMaker / PIXI.js that elastically jiggles the tapped part of an image.
    I would like to reproduce this in Unity.

    This is done by using the Displacement Filter in PIXI.js. It draws radial gradients on the canvas for the filter to transform the image.

    By changing the color of the gradient, the intensity and direction of the jiggling can be changed.
    Easing function is used to change the color to give elasticity to the jiggling.

    In addition, by placing a mask over the top of the gradient, you can specify areas in the image that will not be jiggled.

    The game I want to create is 2D, and I want to make a part of a 2D picture jiggle like this.

    I am beginning to understand that I should be able to do this with ShaderGraph, but I am struggling to figure out how to make the tapped area shake, have elasticity in the shaking, and masking.

    Is there any tutorial that explains these? Any advice on where to start would be appreciated.
    Also, if this Displacement Filter itself can be used in Unity, I would like to know how.