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.

Usage

Use the LocalTransform property to get or set the local transformation of a game object within its parent hierarchy. This is useful for manipulating the game object's position, rotation, and scale in a local context, without affecting its global transformation.

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;