docs.unity3d.com
    Show / Hide Table of Contents

    Enum XRBaseInteractable.MovementType

    Options for how to process and perform movement of an Interactable.

    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public enum MovementType
    Remarks

    Each method of movement has tradeoffs, and different values may be more appropriate for each type of Interactable object in a project.

    Fields

    Name Description Value
    VelocityTracking

    Move the Interactable object by setting the velocity and angular velocity of the Rigidbody. Use this if you don't want the object to be able to move through other Colliders without a Rigidbody as it follows the Interactor, however with the tradeoff that it can appear to lag behind and not move as smoothly as Instantaneous.


    Unity sets the velocity values during the FixedUpdate function. This Interactable will move at the framerate-independent interval of the Physics update, which may be slower than the Update rate. If the Rigidbody is not set to use interpolation or extrapolation, as the Interactable follows the Interactor, it may not visually update position each frame and be a slight distance behind the Interactor or controller due to the difference between the Physics update rate and the render update rate.

    0
    Kinematic

    Move the Interactable object by moving the kinematic Rigidbody towards the target position and orientation. Use this if you want to keep the visual representation synchronized to match its Physics state, and if you want to allow the object to be able to move through other Colliders without a Rigidbody as it follows the Interactor.


    Unity will call the movement methods during the FixedUpdate function. This Interactable will move at the framerate-independent interval of the Physics update, which may be slower than the Update rate. If the Rigidbody is not set to use interpolation or extrapolation, as the Interactable follows the Interactor, it may not visually update position each frame and be a slight distance behind the Interactor or controller due to the difference between the Physics update rate and the render update rate. Collisions will be more accurate as compared to Instantaneous since with this method, the Rigidbody will be moved by settings its internal velocity rather than instantly teleporting to match the Transform pose.

    1
    Instantaneous

    Move the Interactable object by setting the position and rotation of the Transform every frame. Use this if you want the visual representation to be updated each frame, minimizing latency, however with the tradeoff that it will be able to move through other Colliders without a Rigidbody as it follows the Interactor.


    Unity will set the Transform values each frame, which may be faster than the framerate-independent interval of the Physics update. The Collider of the Interactable object may be a slight distance behind the visual as it follows the Interactor due to the difference between the Physics update rate and the render update rate. Collisions will not be computed as accurately as Kinematic since with this method, the Rigidbody will be forced to instantly teleport poses to match the Transform pose rather than moving the Rigidbody through setting its internal velocity.

    2
    See Also
    movementType
    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