Vector3 WorldPosition { get; set; }

robot_2Generated
code_blocksInput

Description

The WorldPosition property represents the position of the game object in world coordinates. It is a Vector3 value that provides the exact location of the game object within the scene, independent of its parent objects.

Usage

Use the WorldPosition property to get or set the position of a game object in the world space. This is useful when you need to position an object relative to the entire scene rather than its parent object.

Example

// Example of setting the WorldPosition of a component
Component myComponent = new Component();
myComponent.WorldPosition = new Vector3(10.0f, 5.0f, 3.0f);

// Example of getting the WorldPosition of a component
Vector3 position = myComponent.WorldPosition;
// position now holds the world coordinates of the game object