Description
The Position
property of a SceneObject
represents its location in the 3D space. This position is relative to its parent SceneObject
if one is set, or to the SceneWorld
if no parent is specified. 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 its 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 in-game debugging tools or UI elements to display information
DebugOverlay.Text(currentPosition.ToString(), myObject.Position);