Description
The LocalScale
property of the GameTransform
class represents the scale of the object in local coordinates. This property is of type Vector3
, which means it contains three components: X, Y, and Z, each representing the scale factor along the respective axis.
This property is marked as obsolete, indicating that it is recommended to use LocalScale
instead of Transform.LocalScale
for accessing or modifying the local scale of a game object.
Usage
To access or modify the local scale of a game object, you can use the LocalScale
property. This property allows you to get or set the scale of the object relative to its parent.
Example usage:
GameTransform transform = myGameObject.Transform;
Vector3 currentScale = transform.LocalScale;
transform.LocalScale = new Vector3(2.0f, 2.0f, 2.0f);
In this example, currentScale
retrieves the current local scale of the game object, and then the scale is set to double its original size along all axes.
Example
GameTransform transform = myGameObject.Transform;
Vector3 currentScale = transform.LocalScale;
transform.LocalScale = new Vector3(2.0f, 2.0f, 2.0f);