Description
The Local
property of the GameTransform
class represents the current local transform of a game object. This property provides access to the transform relative to the object's parent, allowing you to manipulate or retrieve the position, rotation, and scale of the object in local space.
Usage
Use the Local
property to get or set the local transform of a game object. This is useful when you need to adjust the object's transform relative to its parent, rather than in world space.
Example
// Example of accessing and modifying the Local transform of a GameObject
GameTransform gameTransform = myGameObject.Transform;
// Get the current local transform
Transform localTransform = gameTransform.Local;
// Modify the local position
localTransform.Position += new Vector3(1, 0, 0);
// Apply the modified transform back to the GameObject
gameTransform.Local = localTransform;