Version: 2017.4
public Vector3 localPosition ;

説明

親の Transform オブジェクトから見た相対的な位置

Transform に親がいない場合は、値は Transform.position と同じになります。

    // Move the object to the same position as the parent:
    transform.localPosition = Vector3(0, 0, 0);

// Get the y component of the position relative to the parent // and print it to the Console print(transform.localPosition.y);

ワールド位置を計算するときに、親の Transform のワールドの回転とスケールが、ローカルの位置に適用されることに注意してください。 この意味は Transform.position が常に 1 unit である場合は 1 unit であり続け、Transform.localPosition の 1 unit はすべての祖先のスケールを得た上での値となります。