Description
The LocalScale
property of a GameObject
represents the scale of the object relative to its parent. This property is a Vector3
type, 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 dynamically resizing objects in your scene based on game logic or user input.
Example
// Example of setting the local scale of a GameObject
GameObject myObject = new GameObject();
myObject.LocalScale = new Vector3(2.0f, 2.0f, 2.0f); // Doubles the size of the object in all dimensions