Weighted Random Tile | 2D Tilemap Extras | 1.5.0-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Weighted Random Tile

    Contributions by: nicovain, distantcam

    Weighted Random Tiles are tiles which randomly pick a sprite from a given list of sprites and a target location, and displays that sprite. The sprites can be weighted with a value to change its probability of appearing. The Sprite displayed for the Tile is randomized based on its location and will be fixed for that particular location.

    Properties

    Property Function
    Number of Sprites The number of Sprites to randomize from.
    Sprite A Sprite to randomize with.
    Weight A Weight of the Sprite to randomize with.
    Color The Color of the Tile.
    Collider Type The Collider Shape generated by the Tile.

    Usage

    Set up the Weighted Random Tile with the Sprites to select from. The Weight of each Sprite determines the probability of the appearance of the Sprite where the higher the weight, the higher the probability of appearance.

    Weighted Random Tile Editor

    Paint the Weighted Random Tile using the Tile Palette tools.

    Scene View with Weighted Random Tile

    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