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.
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.
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 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);