Description
The World
property of the GameTransform
class provides access to the current world transform of a game object. This transform represents the position, rotation, and scale of the object in world coordinates, as opposed to local coordinates which are relative to the object's parent.
Usage
Use the World
property to get or set the world transform of a game object. This is useful when you need to manipulate or query the object's position, rotation, or scale in the global context of the scene.
Example
// Example of accessing the World property
GameTransform transform = someGameObject.Transform;
Transform worldTransform = transform.World;
// Example of setting the World property
Transform newWorldTransform = new Transform();
newWorldTransform.Position = new Vector3(10, 0, 5);
newWorldTransform.Rotation = Rotation.From(0, 90, 0);
transform.World = newWorldTransform;