Search Results for

    Show / Hide Table of Contents

    Class KaijuAgentsSpeed

    Extension methods to get the speed at which an object is travelling along the X and Z axes. Methods without a delta time value will use Time.deltaTime. All three-dimensional vectors will be flattened via methods in KaijuAgentsFlatten.

    Inheritance
    System.Object
    KaijuAgentsSpeed
    Namespace: KaijuSolutions.Agents.Extensions
    Syntax
    public static class KaijuAgentsSpeed

    Methods

    Speed(Component, Component)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, Component previous)
    Parameters
    Type Name Description
    Component current

    The current position.

    Component previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, Component, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, Component previous, float delta)
    Parameters
    Type Name Description
    Component current

    The current position.

    Component previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, GameObject)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, GameObject previous)
    Parameters
    Type Name Description
    Component current

    The current position.

    GameObject previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, GameObject, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, GameObject previous, float delta)
    Parameters
    Type Name Description
    Component current

    The current position.

    GameObject previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, Transform)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, Transform previous)
    Parameters
    Type Name Description
    Component current

    The current position.

    Transform previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, Transform, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, Transform previous, float delta)
    Parameters
    Type Name Description
    Component current

    The current position.

    Transform previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, Vector2)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, Vector2 previous)
    Parameters
    Type Name Description
    Component current

    The current position.

    Vector2 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, Vector2, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, Vector2 previous, float delta)
    Parameters
    Type Name Description
    Component current

    The current position.

    Vector2 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, Vector3)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, Vector3 previous)
    Parameters
    Type Name Description
    Component current

    The current position.

    Vector3 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Component, Vector3, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Component current, Vector3 previous, float delta)
    Parameters
    Type Name Description
    Component current

    The current position.

    Vector3 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, Component)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, Component previous)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    Component previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, Component, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, Component previous, float delta)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    Component previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, GameObject)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, GameObject previous)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    GameObject previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, GameObject, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, GameObject previous, float delta)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    GameObject previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, Transform)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, Transform previous)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    Transform previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, Transform, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, Transform previous, float delta)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    Transform previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, Vector2)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, Vector2 previous)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    Vector2 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, Vector2, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, Vector2 previous, float delta)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    Vector2 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, Vector3)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, Vector3 previous)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    Vector3 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(GameObject, Vector3, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this GameObject current, Vector3 previous, float delta)
    Parameters
    Type Name Description
    GameObject current

    The current position.

    Vector3 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, Component)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, Component previous)
    Parameters
    Type Name Description
    Transform current

    The current position.

    Component previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, Component, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, Component previous, float delta)
    Parameters
    Type Name Description
    Transform current

    The current position.

    Component previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, GameObject)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, GameObject previous)
    Parameters
    Type Name Description
    Transform current

    The current position.

    GameObject previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, GameObject, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, GameObject previous, float delta)
    Parameters
    Type Name Description
    Transform current

    The current position.

    GameObject previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, Transform)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, Transform previous)
    Parameters
    Type Name Description
    Transform current

    The current position.

    Transform previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, Transform, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, Transform previous, float delta)
    Parameters
    Type Name Description
    Transform current

    The current position.

    Transform previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, Vector2)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, Vector2 previous)
    Parameters
    Type Name Description
    Transform current

    The current position.

    Vector2 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, Vector2, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, Vector2 previous, float delta)
    Parameters
    Type Name Description
    Transform current

    The current position.

    Vector2 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, Vector3)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, Vector3 previous)
    Parameters
    Type Name Description
    Transform current

    The current position.

    Vector3 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Transform, Vector3, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Transform current, Vector3 previous, float delta)
    Parameters
    Type Name Description
    Transform current

    The current position.

    Vector3 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, Component)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, Component previous)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    Component previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, Component, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, Component previous, float delta)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    Component previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, GameObject)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, GameObject previous)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    GameObject previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, GameObject, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, GameObject previous, float delta)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    GameObject previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, Transform)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, Transform previous)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    Transform previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, Transform, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, Transform previous, float delta)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    Transform previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, Vector2)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, Vector2 previous)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    Vector2 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, Vector2, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, Vector2 previous, float delta)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    Vector2 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, Vector3)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, Vector3 previous)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    Vector3 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector2, Vector3, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector2 current, Vector3 previous, float delta)
    Parameters
    Type Name Description
    Vector2 current

    The current position.

    Vector3 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, Component)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, Component previous)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    Component previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, Component, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, Component previous, float delta)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    Component previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, GameObject)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, GameObject previous)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    GameObject previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, GameObject, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, GameObject previous, float delta)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    GameObject previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, Transform)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, Transform previous)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    Transform previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, Transform, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, Transform previous, float delta)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    Transform previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, Vector2)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, Vector2 previous)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    Vector2 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, Vector2, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, Vector2 previous, float delta)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    Vector2 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, Vector3)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, Vector3 previous)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    Vector3 previous

    The previous position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    Speed(Vector3, Vector3, Single)

    The current speed based on the time it took to move from a previous position.

    Declaration
    public static float Speed(this Vector3 current, Vector3 previous, float delta)
    Parameters
    Type Name Description
    Vector3 current

    The current position.

    Vector3 previous

    The previous position.

    System.Single delta

    The time since the last position.

    Returns
    Type Description
    System.Single

    The current speed based on the time it took to move from a previous position.

    In This Article
    Back to top MIT License © 2026 Kaiju Solutions Inc.