Description
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. This property is useful for adjusting the size of the object without affecting its position or rotation.
Usage
To use the LocalScale
property, you can get or set its value to adjust the scale of the game object. This can be done in the context of a component that is attached to a game object.
Example
// Example of setting the local scale of a game object
public class ScaleAdjuster : Component
{
public void AdjustScale(Vector3 newScale)
{
// Set the local scale of the game object
this.LocalScale = newScale;
}
public Vector3 GetCurrentScale()
{
// Get the current local scale of the game object
return this.LocalScale;
}
}