⮞ Go to NeoFPS.com

    Show / Hide Table of Contents

    SlopeSpeedCurve ScriptableObject

    Overview

    The SlopeSpeedCurve scriptable object is used by the grounded Movement state to allow more control over the character's speed on slopes. The X axis of the curve represents the slope, from slope limit downhill at -1 to completely flat at 0 and up to the character slope limit uphill at 1. The y value is the amount of horizontal speed that is maintained when deflected by the slope.

    NeoCharacterController Slope Speed Curve

    The Movement state aligns its target velocity to the ground surface, clamps the new move vector to the original movement speed and then multiplies by the result of the slope speed curve at the relevant angle. This means that the character can maintain their speed up to a set angle and then it drops off slowly as they approach the limit instead of hitting an invisible wall as the slope angle increases.

    Inspector

    MotionGraph

    Properties

    Name Type Description
    Curve AnimationCurve The desired speed curve as specified above. Ensure that the x-axis extends from -1 to 1 and the y-axis does not go below 0.

    See Also

    Movement MotionGraphState

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