docs.unity3d.com
    Show / Hide Table of Contents

    Interface IXRAimAssist

    An interface that allows for computing an altered projectile velocity to allow for assisted aiming. This can be used to allow a user to throw a grab interactable to where they are looking.

    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public interface IXRAimAssist

    Methods

    GetAssistedVelocity(in Vector3, in Vector3, Single)

    Takes a projectile's velocity and adjusts it to more closely hit a given target.

    Declaration
    Vector3 GetAssistedVelocity(in Vector3 source, in Vector3 velocity, float gravity)
    Parameters
    Type Name Description
    Vector3 source

    The starting position of the projectile.

    Vector3 velocity

    The starting velocity of the projectile.

    Single gravity

    How much gravity the projectile is experiencing.

    Returns
    Type Description
    Vector3

    Returns a velocity based on the source, but adjusted to hit a given target.

    GetAssistedVelocity(in Vector3, in Vector3, Single, Single)

    Takes a projectile's velocity and adjusts it to more closely hit a given target.

    Declaration
    Vector3 GetAssistedVelocity(in Vector3 source, in Vector3 velocity, float gravity, float maxAngle)
    Parameters
    Type Name Description
    Vector3 source

    The starting position of the projectile.

    Vector3 velocity

    The starting velocity of the projectile.

    Single gravity

    How much gravity the projectile is experiencing.

    Single maxAngle

    If the angle between the initial velocity and adjusted velocity is greater than this value, no adjustment will occur.

    Returns
    Type Description
    Vector3

    Returns a velocity based on the source, but adjusted to hit a given target.

    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