2D Sprite Shape | 2D SpriteShape | 4.1.5
docs.unity3d.com
    Show / Hide Table of Contents

    2D Sprite Shape

    Overview

    The Sprite Shape is a flexible and powerful world building Asset that features Sprite tiling along a shape's outline that automatically deforms and swaps Sprites based on the angle of the outline. Additionally, you can assign a Fill texture to a Sprite Shape to create filled shapes with tiled textures as backgrounds or other large level-building props.

    The following are examples of Sprite Shapes used to construct different parts of various levels.

    Sprite Shapes comprise of two parts - the Sprite Shape Profile Asset, and the Sprite Shape Controller component. The Sprite Shape Profile contains the angle settings and Sprites used by the Sprite Shape, and you edit the Sprite Shape's outline with the Sprite Shape Controller component.

    Importing Sprites for Sprite Shapes

    We recommend using the following settings when importing Sprites for a Sprite Shape:

    1. Texture Type - Set this to Sprite (2D and UI). Other texture types are not supported for Sprite Shapes.
    2. Sprite Mode - Set this to Single if the texture contains only a single Sprite.
    3. Mesh Type - Set this to Full Rect.

    Sprite Shape Workflow

    Create Sprite Shapes in following the steps:

    1. Create a Sprite Shape Profile from the main menu (menu: Assets > Create > Sprite Shape Profile). Select from the two available options:
      • Open Shape
      • Closed Shape
    2. Create Angle Ranges and assign Sprites in the Sprite Shape Profile.
    3. Drag the Sprite Shape Profile into the Scene to automatically generate a Sprite Shape GameObject based on that Profile.
      • You can create a Sprite Shape GameObject without a Profile from the main menu (menu: GameObject > 2D Object > Sprite Shape). Then select a Sprite Shape Profile in the Sprite Shape Controller's Profile settings. The same Profile can be used by multiple Sprite Shapes.
    4. Edit the outline of the Sprite Shape with the Sprite Shape Controller component settings.
    5. Enable Physics2D interactions for your Sprite Shapes by attaching a Collider component.
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023