Transform GetLocalTransform()

robot_2Generated
code_blocksInput

Description

The GetLocalTransform method retrieves the local transformation matrix of a game object. This transformation matrix represents the position, rotation, and scale of the object relative to its parent in the scene hierarchy.

Usage

Use the GetLocalTransform method when you need to access the local transformation of a game object. This is particularly useful when you want to manipulate or query the object's position, rotation, or scale in relation to its parent object.

Example

// Assuming 'transformProxy' is an instance of TransformProxy
Transform localTransform = transformProxy.GetLocalTransform();

// Accessing position, rotation, and scale from the local transform
Vector3 localPosition = localTransform.Position;
Quaternion localRotation = localTransform.Rotation;
Vector3 localScale = localTransform.Scale;

// Example usage: printing the local position
// Note: Use appropriate logging or debugging methods to view the output
// Debug.Log(localPosition);