Version: 2021.2
LanguageEnglish
  • C#

InputTracking.GetNodeStates

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static void GetNodeStates(List<XRNodeState> nodeStates);

Parameters

nodeStates A list that is populated with XRNodeState objects.

Description

Describes all currently connected XRNodes and provides available tracking states for each.

Use this method to acquire all the currently available XR input Nodes, as an alternative to handling the node events InputTracking.nodeAdded and InputTracking.nodeRemoved. The contents of nodeStates list will be cleared and replaced with fresh data.
Not all XR platforms provide complete tracking data. Use the methods XRNodeState.TryGetPosition, XRNodeState.TryGetRotation, etc. to read the data if it's available.