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.
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.
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 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;