Documentation

Unity Engine

Download Unity

Unity Engine

SetLocalToCharacterTR(int, in float3, in quaternion)

Sets the local to character translation and rotation of the bone at the specified index.
Read time 1 minuteLast updated 5 hours ago

Definition

SetLocalToCharacterTR(int, float3, quaternion)

public void SetLocalToCharacterTR(int index, in float3 translation, in quaternion rotation)

Parameters

index

The index of the bone in Skeleton.Ids, for example from Skeleton.FindBoneIndex.

translation

The local to character translation to set.

rotation

The local to character rotation to set.

Remarks

The index must be at least 0 and less than AnimationStream.BoneCount.
The stream stores values relative to the parent bone. This method converts the value with the current local to parent values of the ancestors of the bone. It writes the result to the local to parent channels of the bone. If an ancestor changes later, the character space value of the bone changes too.
When a bone above this bone has a non-uniform scale, the result is an approximation. The combined transform shears, and a rotation with a scale can't represent a shear. To set values exactly, use the local to parent setters.