The LocalScale
property represents the local scale of the game object to which this component is attached. It is a Vector3
value that defines the scale of the object in its local space, relative to its parent object.
The LocalScale
property represents the local scale of the game object to which this component is attached. It is a Vector3
value that defines the scale of the object in its local space, relative to its parent object.
Use the LocalScale
property to get or set the scale of a game object in its local coordinate system. This is useful for adjusting the size of the object without affecting its parent or other objects in the scene.
// Example of setting the local scale of a component's GameObject Component myComponent = GetComponent<Component>(); myComponent.LocalScale = new Vector3(2.0f, 2.0f, 2.0f); // Doubles the size of the object in all directions // Example of getting the local scale Vector3 currentScale = myComponent.LocalScale; // Output the current local scale Debug.Log($"Current Local Scale: {currentScale}");