Vector3 WorldScale { get; set; }

robot_2Generated
code_blocksInput

Description

The WorldScale property of a GameObject represents the scale of the object in world coordinates. This property is crucial for understanding how the object is scaled relative to the entire scene, as opposed to its local scale which is relative to its parent.

Usage

Use the WorldScale property to get or set the scale of a GameObject in world space. This can be useful when you need to adjust the size of an object based on global factors or when you need to ensure that the object maintains a specific size in the world regardless of its parent transformations.

Example

// Example of setting the WorldScale of a GameObject
GameObject myObject = new GameObject();
myObject.WorldScale = new Vector3(2.0f, 2.0f, 2.0f); // Sets the world scale to double its size in all dimensions

// Example of getting the WorldScale of a GameObject
Vector3 currentScale = myObject.WorldScale;
// Use currentScale for further calculations or logic