docs.unity3d.com
    Show / Hide Table of Contents

    Animate a GameObject along a spline

    Move a GameObject along a spline.

    Use the Spline Animate component to define the movement of cameras, characters, or other GameObjects in the Editor.

    You must have a GameObject with a Spline component attached to it in your scene to select as the target spline for the Spline Animate component.

    By default, the Spline Animate component uses the Time method to animate a GameObject with set to complete after 1 second. To change what animation method your GameObject uses and how it moves along its target spline, refer to Configure the movement of a GameObject.

    To animate a GameObject along a spline:

    1. Add the Spline Animate component to a GameObject that you want to animate along a spline.
    2. In the Spline Animate component, for the Spline property, select a GameObject that has an attached Spline component that you want to animate on.
    3. To view the animation in the Scene view, select Play in the Spline Animate component's Preview panel.

    Additional resources

    • Control the animated GameObject's movement
    • Change the alignment of an animated GameObject
    • Spline Animate component reference
    • Use components
    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