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 displays that Sprite at the target location. Adjusting the Weight value of the Sprites changes their probability of appearing. The Sprite displayed for the Tile is randomized based on its location and remains fixed for that particular location.

    Properties

    Weighted Random Tile Editor

    Property Function
    Number of Sprites The number of Sprites to randomize from.
    Sprite A Sprite that is in the randomize pool.
    Weight A Weight value of the Sprite that affects its probability of appearing.
    Color The color of the Tile.
    Collider Type The Collider Shape generated by the Tile.

    Usage

    Select the Sprites to randomize from in the Weighted Random Tile editor. 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. Paint the Weighted Random Tile onto the Tilemap with 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