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, relative to the world origin.

Usage

Use the WorldPosition property to get or set the position of a game object in the world space. This is useful for positioning objects in the scene or for calculating distances between objects.

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;

// Output the world position
// Note: Use a logging system or debugger to view the output
// Debug.Log(position);