Description
The LocalScale
property of a GameObject
represents the scale of the object relative to its parent. This property is of type Vector3
, allowing you to specify the scale along the X, Y, and Z axes independently. Adjusting the local scale affects how the object is rendered in the scene, without altering its position or rotation.
Usage
To modify the local scale of a GameObject
, you can directly set the LocalScale
property with a new Vector3
value. This is useful for resizing objects dynamically during runtime.
Example
// Example of setting the local scale of a GameObject
GameObject myObject = new GameObject();
myObject.LocalScale = new Vector3(2.0f, 2.0f, 2.0f); // Sets the scale to double its original size in all directions