Tes3Mod:GetPos

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search


GetPos

                GetPos, Axis

       Where:   Axis = Which world axis to get the object's position (X, Y, or Z).
                                
        Type:   Movement

     Returns:   float

     Example:   if ( misc_com_wood_bowl_02->GetPos, Z >= 400 )
                if ( GetPos, Y < 0 )
                set TempFloat to ( GetPos, X )

     Scripts:   cavein_script
                testmoverock

Returns a float value of the calling object's current position in the world along the specified axis. Does not always return the object's position if the object is not in the same cell (or close to) the player (returns 0 instead). In such a case, it is better to store the object's position when you know the player is close by (such as when the item is dropped) and use them later.

When used with the fix operator, the function will return the position of the first instance of the object (regardless of whether that object has been disabled or deleted). So, use with the fix operator should be restricted to unique objects (e.g., unique NPCs, creatures, etc. (Which means that it should not be used with any object thhat can be picked up, since such objects are inherently non-unique.)

See Also: SetPos