Vector3 LocalScale { get; set; }

book_4_sparkGenerated
code_blocksInput

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.

Usage

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

// 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); // Doubles the size of the object in all dimensions

// Example of getting the local scale
Vector3 currentScale = myComponent.LocalScale;
// Output the current local scale
// Note: Avoid using Console.WriteLine in Sandbox, use in-game debugging tools instead