Vector3 Position

book_4_sparkGenerated
code_blocksInput

Description

The Position field of the Transform struct represents the position of the transform in 3D space. It is a public, non-static field of type Vector3. This field is included in JSON serialization and is also included in the action graph, as indicated by the JsonInclude, JsonPropertyName, and ActionGraphInclude attributes.

Usage

Use the Position field to get or set the position of a Transform in 3D space. This is useful for positioning entities, bones, or scene objects within the game world.

Example

// Example of setting the position of a Transform
Transform myTransform = new Transform();
myTransform.Position = new Vector3(10, 20, 30);

// Example of getting the position of a Transform
Vector3 currentPosition = myTransform.Position;

// Output the position
// Note: Avoid using Console.WriteLine in s&box
// Instead, use in-game debugging tools or UI elements to display information
// Debug.Log(currentPosition); // Hypothetical example for in-game logging