docs.unity3d.com
    Show / Hide Table of Contents

    Class SplineInstantiate

    SplineInstantiate is used to automatically instantiate prefabs or objects along a spline.

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    SplineComponent
    SplineInstantiate
    Inherited Members
    SplineComponent.GetAxis(SplineComponent.AlignAxis)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    MonoBehaviour.CancelInvoke(String)
    MonoBehaviour.IsInvoking(String)
    MonoBehaviour.StartCoroutine(String)
    MonoBehaviour.StartCoroutine(String, Object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(String)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(Object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, Boolean)
    Component.GetComponentInParent(Type)
    UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(String)
    Component.SendMessageUpwards(String, Object, SendMessageOptions)
    Component.SendMessageUpwards(String, Object)
    Component.SendMessageUpwards(String)
    Component.SendMessageUpwards(String, SendMessageOptions)
    Component.SendMessage(String, Object)
    Component.SendMessage(String)
    Component.SendMessage(String, Object, SendMessageOptions)
    Component.SendMessage(String, SendMessageOptions)
    Component.BroadcastMessage(String, Object, SendMessageOptions)
    Component.BroadcastMessage(String, Object)
    Component.BroadcastMessage(String)
    Component.BroadcastMessage(String, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, Boolean)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.ToString()
    Object.name
    Object.hideFlags
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.Splines
    Syntax
    [ExecuteInEditMode]
    [AddComponentMenu("Splines/Spline Instantiate")]
    public class SplineInstantiate : SplineComponent

    Properties

    Container

    The SplineContainer containing the targeted spline.

    Declaration
    public SplineContainer Container { get; set; }
    Property Value
    Type Description
    SplineContainer

    CoordinateSpace

    The coordinate space in which to orient the instanced object.

    Declaration
    public SplineInstantiate.Space CoordinateSpace { get; set; }
    Property Value
    Type Description
    SplineInstantiate.Space

    ForwardAxis

    Forward axis of the object, by default set to the Z Axis

    Declaration
    public SplineComponent.AlignAxis ForwardAxis { get; set; }
    Property Value
    Type Description
    SplineComponent.AlignAxis

    InstantiateMethod

    The instantiation method to use.

    Declaration
    public SplineInstantiate.Method InstantiateMethod { get; set; }
    Property Value
    Type Description
    SplineInstantiate.Method

    MaxPositionOffset

    Maximum (X,Y,Z) position offset to randomize instanced objects positions. (X,Y and Z) values have to be higher to the ones of minPositionOffset.

    Declaration
    public Vector3 MaxPositionOffset { get; set; }
    Property Value
    Type Description
    Vector3

    MaxRotationOffset

    Maximum (X,Y,Z) euler rotation offset to randomize instanced objects rotations. (X,Y and Z) values have to be higher to the ones of minRotationOffset.

    Declaration
    public Vector3 MaxRotationOffset { get; set; }
    Property Value
    Type Description
    Vector3

    MaxScaleOffset

    Maximum (X,Y,Z) scale offset to randomize instanced objects scales. (X,Y and Z) values have to be higher to the ones of minScaleOffset.

    Declaration
    public Vector3 MaxScaleOffset { get; set; }
    Property Value
    Type Description
    Vector3

    MinPositionOffset

    Minimum (X,Y,Z) position offset to randomize instanced objects positions. (X,Y and Z) values have to be lower to the ones of maxPositionOffset.

    Declaration
    public Vector3 MinPositionOffset { get; set; }
    Property Value
    Type Description
    Vector3

    MinRotationOffset

    Minimum (X,Y,Z) euler rotation offset to randomize instanced objects rotations. (X,Y and Z) values have to be lower to the ones of maxRotationOffset.

    Declaration
    public Vector3 MinRotationOffset { get; set; }
    Property Value
    Type Description
    Vector3

    MinScaleOffset

    Minimum (X,Y,Z) scale offset to randomize instanced objects scales. (X,Y and Z) values have to be lower to the ones of maxScaleOffset.

    Declaration
    public Vector3 MinScaleOffset { get; set; }
    Property Value
    Type Description
    Vector3

    PositionSpace

    Coordinate space to use to offset positions of the instances.

    Declaration
    public SplineInstantiate.OffsetSpace PositionSpace { get; set; }
    Property Value
    Type Description
    SplineInstantiate.OffsetSpace

    RotationSpace

    Coordinate space to use to offset rotations of the instances.

    Declaration
    public SplineInstantiate.OffsetSpace RotationSpace { get; set; }
    Property Value
    Type Description
    SplineInstantiate.OffsetSpace

    ScaleSpace

    Coordinate space to use to offset rotations of the instances (usually OffsetSpace.Object).

    Declaration
    public SplineInstantiate.OffsetSpace ScaleSpace { get; set; }
    Property Value
    Type Description
    SplineInstantiate.OffsetSpace

    UpAxis

    Up axis of the object, by default set to the y-axis.

    Declaration
    public SplineComponent.AlignAxis UpAxis { get; set; }
    Property Value
    Type Description
    SplineComponent.AlignAxis

    Methods

    Clear()

    Clear all the created instances along the spline

    Declaration
    public void Clear()

    Randomize()

    Change the Random seed to obtain a new generation along the Spline

    Declaration
    public void Randomize()

    SetDirty()

    Set the created instances dirty to erase them next time instances will be generated (otherwise the next generation will reuse cached instances)

    Declaration
    public void SetDirty()

    UpdateInstances()

    Create and update all instances along the spline based on the list of available prefabs/objects.

    Declaration
    public void UpdateInstances()
    Back to top
    Terms of use
    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