Vector3 LocalPosition { get; set; }

robot_2Generated
code_blocksInput

Description

The LocalPosition property represents the local position of the game object within its parent. It is a Vector3 value that specifies the position relative to the parent object's origin. This property is useful for manipulating the position of a game object in a local context, without affecting its global position in the scene.

Usage

To use the LocalPosition property, you can get or set its value to adjust the local position of the game object. This is typically done within a component that is attached to the game object.

Example

// Example of setting the local position of a game object
Component myComponent = GetComponent<Component>();
myComponent.LocalPosition = new Vector3(1.0f, 2.0f, 3.0f);

// Example of getting the local position of a game object
Vector3 currentLocalPosition = myComponent.LocalPosition;

// Adjusting the local position
myComponent.LocalPosition += new Vector3(0.5f, 0.0f, 0.0f);