⮞ Go to NeoFPS.com

    Show / Hide Table of Contents

    WaypointMovingPlatform MonoBehaviour

    Overview

    The WaypointMovingPlatform behaviour is used to create a moving platform that moves between a set of waypoints.

    The waypoints include position and rotation and can be moved to in sequence or directly. The waypoints can also be set to loop round from last back to first, or to form a broken chain.

    Movement can be triggered on startup so the platform loops through waypoints, or it can be triggered via scripts and UnityEvents. Using scripting and events you can set the platform to move to a specific waypoint, either via the intermediate waypoints or directly, or you can start and stop the platform looping through waypoints.

    Inspector

    WaypointMovingPlatform

    Properties

    Name Type Description
    Starting Waypoint Integer The waypoint the platform starts at (will be repositioned on start).
    Speed Curve AnimationCurve An animation curve to apply easing to movement between waypoints.
    Delay Float The delay between waypoints when moving through a sequence. The platform will stop at a waypoint for this duration.
    On Start Dropdown What to do on start. Options are as follows:
    • Nothing - the platform will not do anything until another script or component triggers it.
    • Loop Forwards - the platform will keep looping through all of the waypoints in order until stopped. If the waypoints are not circular, it will change directions when it reaches the last waypoint.
    • Loop Backwards - the platform will keep looping through all of the waypoints in reverse order until stopped. If the waypoints are not circular, it will change directions when it reaches the first waypoint.
    Circular Boolean If the waypoints are circular then there is a direct route from the first to last waypoints without going through the others.
    Interruptable Boolean Defines how the platform behaves when setting the target waypoint while already moving. If interruptable, the platform will immediately switch to the new target waypoint, reversing direction if necessary. If not interruptable, then the platform will move to the next waypoint and then change directions if required.

    The inspector then shows a list of waypoints with the following properties:

    Name Type Description
    Position Vector3 The position of the platform at this waypoint.
    Rotation Vector3 The rotation of the platform at this waypoint.
    Time To Waypoint X Float The journey time to reach the next platform in the sequence.
    Use Current Transform Button Set the position and rotation to match the platform transform in the scene.
    Move To Waypoint Button Instantly move the platform transform to the position and rotation of the waypoint in the scene.
    Up Button Move this waypoint up in the sequence.
    Down Button Move this waypoint down in the sequence.
    Insert After Button This will insert a new waypoint immediately after this one.
    Remove Button This will remove the waypoint from the list.

    See Also

    Moving Platforms

    Back to top Copyright © 2019 Yondernauts Game Studios Ltd
    Generated with DocFX