The WorldTransform
property provides the world transform of the game object. This includes the position, rotation, and scale of the game object in the world space, as opposed to its local space relative to its parent.
The WorldTransform
property provides the world transform of the game object. This includes the position, rotation, and scale of the game object in the world space, as opposed to its local space relative to its parent.
Use the WorldTransform
property to get or set the transform of a game object in the world space. This is useful when you need to position or orient the game object globally, without regard to its parent or local hierarchy.
// Example of accessing the WorldTransform property Component myComponent = someGameObject.GetComponent<Component>(); Transform worldTransform = myComponent.WorldTransform; // Example of setting the WorldTransform property Transform newTransform = new Transform(); newTransform.Position = new Vector3(10, 0, 5); newTransform.Rotation = Rotation.From(0, 90, 0); newTransform.Scale = new Vector3(1, 1, 1); myComponent.WorldTransform = newTransform;