docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Spline Instantiate component reference

    Use the Spline Instantiate component to instantiate GameObjects on a spline.

    Property Description
    Container Select a GameObject that has an attached Spline component you want to instantiate GameObjects or prefabs on.
    Items To Instantiate Create a list of GameObjects or prefabs you want to instantiate. For each element in the list, select a GameObject or prefab, and set a probability for that item to instantiate on the spline.
    Up Axis Select the axis instantiated items use as their up direction. The y-axis is the default up direction.
    Forward Axis Select the axis instantiated items use as their forward direction. The z-axis is the default forward direction.
    Align To Select the space that instantiated items orient to.
    The following spaces are available:
    • Spline Element: Align instantiated items to an interpolated orientation calculated from the rotation of the knots closest to where each item instantiates.
    • Spline Object: Align the instantiated items to the orientation of the target spline.
    • World Space: Align instantiated items to world space orientation.
    Instantiate Method Select how to instantiate items on the spline.
    The following instantiate methods are available:
    • Instance Count: Instantiate a number of items on the target spline.
    • Spline Distance: Instantiate items separated by distance intervals measured along the spline.
    • Linear Distance: Instantiate items separated by distance intervals measured linearly in world space.
    Count Set a number or an inclusive random range of items to instantiate.
    This property is visible only when you select the Instance Count instantiate method.
    Spacing (Spline) Set the distance interval to instantiate items at. The distance is measured along the spline. You can set an exact distance or an inclusive random range of values.
    This property is visible only when you select the Spline Distance instantiate method.
    Spacing (Linear) Set the distance interval to instantiate items at. The distance is measured linearly in world space.
    To instantiate as many items that can fit on the spline without overlap, select Auto.
    This property is visible only when you select the Linear Distance instantiate method.
    Position Offset Enable to instantiate items at a position relative to the spline.
    Rotation Offset Enable to instantiate items with a rotation relative to the original GameObject.
    Scale Offset Enable to instantiate items with a scale relative to the original GameObject.
    Override space Enable to apply the offset to a coordinate space you select. If you don't enable Override space, the offset applies to the coordinate space you set Align to to.
    This property is visible only when you enable Position Offset, Rotation Offset, or Scale Offset.
    X Set the offset's x-axis value. You can set an exact value or an inclusive random range of values.
    This property is visible only when you enable Position Offset, Rotation Offset, or Scale Offset.
    Y Set the offset's y-axis value. You can set an exact value or an inclusive random range of values.
    This property is visible only when you enable Position Offset, Rotation Offset, or Scale Offset.
    Z Set the offset's z-axis value. You can set an exact value or an inclusive random range of values.
    This property is visible only when you enable Position Offset, Rotation Offset, or Scale Offset.
    Auto Refresh Generation Enable the automatic regeneration of instantiated items when you change the spline or its instantiation values.
    Randomize Regenerate all values set to random ranges, and then instantiate items again.
    Regenerate Instantiate items on the spline again.
    Clear Remove all instantiated items from the spline.
    In This Article
    Back to top
    Copyright © 2024 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)