Vector3 Position { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Position property of a SceneObject represents its location in 3D space. This position is relative to the object's parent, if it has one, or to the SceneWorld if no parent is set. The property is of type Vector3, which typically includes x, y, and z coordinates.

Usage

Use the Position property to get or set the location of a SceneObject within the scene. This can be useful for moving objects around in the game world or for querying their current location.

Example

// Example of setting the position of a SceneObject
SceneObject myObject = new SceneObject();
myObject.Position = new Vector3(10.0f, 5.0f, 3.0f);

// Example of getting the position of a SceneObject
Vector3 currentPosition = myObject.Position;

// Output the current position
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use logging or debugging tools provided by the engine
Log.Info($"Current Position: {currentPosition}");