Transform LocalTransform { get; set; }

robot_2Generated
code_blocksInput

Description

The LocalTransform property provides access to the local transform of the game object. This includes the position, rotation, and scale of the game object relative to its parent. It is a Transform type property, which means it encapsulates all the necessary data to describe the local transformation of the game object within its parent space.

Usage

Use the LocalTransform property to get or set the local transformation of a game object. This is useful when you need to manipulate the game object's position, rotation, or scale relative to its parent object.

Example

// Example of accessing and modifying the LocalTransform property
Component myComponent = someGameObject.GetComponent<Component>();

// Get the current local transform
Transform currentLocalTransform = myComponent.LocalTransform;

// Modify the local position
currentLocalTransform.Position += new Vector3(1, 0, 0);

// Apply the modified transform back to the component
myComponent.LocalTransform = currentLocalTransform;