Skip to content

Juicy Sprite Stretch Manual

codevenient edited this page Feb 1, 2023 · 1 revision

1. Introduction

This manual shows you how to let 2D Sprites stretch and squish as they move around, using our Unity Asset Juicy Sprite Stretch. By adding the Juicy Sprite Stretch component to your Sprites, the images will automatically stretch along their velocity vector as the velocity increases. If you like the Asset, please consider leaving a review in the Asset Store. It will help me a lot.

2. Installation

Juicy Sprite Stretch is available via the Unity Asset Store.

3. Adding the stretch effect to your project

If you already have an a scene with one or more Sprites, and want to add the stretch effect, please refer to Section 3.1. If you have an empty scene and want to set up a stretching Sprite from scratch, please refer to Section 3.2.

3.1 Adding the stretch effect to an existing Sprite

To add Juicy Sprite Stretch to an existing Sprite GameObject, you simply need to add the Juicy Sprite Stretch component.

  1. Click your Sprite GameObject in the Hierarchy and look at its components using the Inspector.

Your GameObject should already contain the Sprite Renderer component, with the Sprite property set to some texture. If not, please refer to Section 3, 'Creating a Sprite with stretch effect from scratch'.

  1. Add the Juicy Sprite Stretch component by clicking the Add Component button and selecting Effects > Juicy Sprite Stretch.

You are ready! In Play Mode, the Sprite should now stretch as the GameObject moves.

Note: the stretch effect is only visible when the GameObject moves. For an example of how to make the GameObject move, please refer to Section 3.2, 'Creating a Sprite with stretch effect from scratch', Step 5 and 6.

3.2 Creating a Sprite with stretch effect from scratch

Note: when you follow these instructions, the Unity Editor should be in 2D mode. If the Editor is not in 2D mode, you can switch to 2D mode by selecting Edit > Projects > Editor and setting the Default Behavior Mode to 2D.

  1. Locate the Sprite asset that you want to use in the Project Window. If you do not have a Sprite asset ready, you can use the Ball Sprite that is bundled with this Asset package. You can find the Ball Sprite in the folder JuicySpriteStretch/Examples/Assets/Sprites.
  2. Add the Sprite to your Scene by dragging it from the Project Window into your scene.
  3. Click the Sprite GameObject (created in Step 2) in the Hierarchy and look at its components using the Inspector.
  4. Add the Juicy Sprite Stretch component by clicking the Add Component button and selecting Effects > Juicy Sprite Stretch.

The stretch effect is only visible when the GameObject moves. In this example, we will make the GameObject move due to gravity.

  1. Click the Sprite GameObject in the Hierarchy and look at its components using the Inspector.
  2. Add a Rigidbody 2D component by clicking the Add Component button and selecting Physics 2D > Rigidbody 2D.
  3. Launch your scene by using Unity’s Play button.

You should now see the Sprite stretch as it moves downwards.

4. Customising the stretch effect

To customise the stretch effect, locate the Juicy Sprite Stretch component in the Inspector and look at its properties. You can edit the following properties:

  • Stretch Amount: how much the sprite stretches as the velocity increases.
  • Maximum Stretch: maximally allowed stretch between 1 and 5. If set to 2, the image can stretch until it is twice as long and thin as the original image.