docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetRelativeLinearVelocity

    GetRelativeLinearVelocity(float3, float3)

    Converts a world space vector into a view-direction relative vector.

    Declaration
    public static float3 GetRelativeLinearVelocity(float3 absoluteLinearVelocity, float3 normalizedViewDirection)
    Parameters
    Type Name Description
    float3 absoluteLinearVelocity

    The world space vector to be converted.

    float3 normalizedViewDirection

    The normalized view direction.

    Returns
    Type Description
    float3

    The converted view-direction relative vector.

    Remarks

    For a third-person controller it is common to convert a 3d-vector into a representation that is relative to a camera. This method takes as input a normalized view direction (e.g. the forward vector of a camera transform) and converts a vector passed as argument into a vector that is relative to the view direction.

    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)