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 position or rotation.
// Example of setting the local scale of a component's GameObject Component myComponent = ...; // Assume this is an existing component myComponent.LocalScale = new Vector3(2.0f, 2.0f, 2.0f); // Sets the local scale to double its original size // Example of getting the local scale Vector3 currentScale = myComponent.LocalScale; // Use currentScale for further calculations or logic