docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Set Position (Signed Distance Field)

    Menu Path : Position > Set Position (Signed Distance Field)

    The Set Position (Signed Distance Field) Block calculates a position based on an input Signed Distance Field (SDF) and stores the result in the position attribute, based on composition.

    This Block can calculate the position either from the SDF's Surface, Volume, or Thick Surface where thickness can be relative to the size of the shape, or an absolute value.

    This Block also calculates a direction vector based on the calculated position on the shape, and stores it to the direction attribute, based on composition. This direction is equal to the normal of the surface at the calculated particle position.

    Note: Velocity from Direction and Speed Blocks can then process the direction attribute.

    Block compatibility

    This Block is compatible with the following Contexts:

    • Initialize
    • Update
    • Any output Context

    Block settings

    Setting Type Description
    Position Mode Enum Specifies how this Block uses the shape to calculate a position. The options are:
    • Surface: Calculates positions only on the shape’s surface.
    • Volume: Calculates positions inside the entire shape’s volume.
    • Thickness Absolute: Calculates positions on a thick surface of given absolute thickness.
    • Thickness Relative Calculates positions on a thick surface as a given percentage of the largest axis’s size.
    Spawn Mode Enum Specifies how this Block distributes the particles among the shape’s arc.
    • Random: Calculates a per-particle random progress (0..1) on the arc.
    • Custom: Allows you to specify the progress in the Arc Sequencer property port.
    Kill Outliers Bool (Inspector) Indicates whether to kill particles whose position does not adhere to the surface/volume.
    Projection Steps uint (Inspector) The number of steps this Block uses to project the particle onto the surface of the SDF. This may impact performance, but can yield less outliers.

    Block properties

    Input Type Description
    Box AABox The Axis-Aligned Box that determines the shape to calculate the position from.
    Thickness float The thickness of the shape’s surface for position calculation.
    This property only appears if you set Position Mode to Thickness Relative or Thickness Absolute.
    Arc Sequencer float The position in the arc to spawn particles.
    This property only appears if you set Spawn Mode to Custom.

    Notes

    This Block calculates the relative thickness based on the largest axis of the SDF, which is not necessarily the size of the object the SDF represents. Therefore, the positions this Block calculates can be inside the entire shape’s volume even with a relative thickness smaller than 1.


    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Block compatibility
    • Block settings
    • Block properties
    • Notes
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)