Version: 2022.2
LanguageEnglish
  • C#

ArticulationBody.GetDriveTargets

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

Switch to Manual

Declaration

public int GetDriveTargets(List<float> targets);

Parameters

targets Supplied list of floats to read back and store the joint drive targets data.

Returns

int Total degrees of freedom for the entire hierarchy of articulation bodies.

Description

Reads back articulation body joint drive targets of the entire hierarchy to the supplied list of floats.

This returns joint drive targets in the reduced coordinate space for the entire articulation hierarchy starting from root to the supplied list of floats. Every joint drive target DOF is represented by one float value, however depending on the type of the articulation joint there might be zero, one or 3 DOFs per joint. The exact location of the data in resulting list for the specific articulation body can be found by calling ArticulationBody.GetDofStartIndices and indexing returned dofStartIndices list by the particular body index via ArticulationBody.index. Number of degrees of freedom for the articulation body can be found using ArticulationBody.dofCount. See Also: index, GetDofStartIndices, dofCount, SetDriveTargets.