setLowLODElement | Multi Theft Auto: Wiki Skip to content

setLowLODElement

Client-side
Server-side
Shared

Pair: getLowLODElement

This function assigns a low LOD element to an element. The low LOD element is displayed when its associated element is not fully visible. If a low LOD element is assigned to several elements, it will be displayed when any of these elements are not fully visible.

Note

The only valid elements types for assigning LODs with this function are object and building.

OOP Syntax Help! I don't understand this!

  • Method:element:setLowLOD(...)
  • Variable: .lowLOD

Syntax

bool setLowLODElement ( ​element theElement, ​element lowLODElement )
Required Arguments
  • theElement: The element whose low LOD version we want to change.
  • lowLODElement: A low LOD element to display when the first element is not fully visible.

Returns

  • bool: result

Returns true if the assignment was successful, false otherwise.

Code Examples

client

This example shows how to create and link a normal and low LOD object:

-- Create a normal object
local objNormal = createObject(3620, x, y, z, 0, 0, 0)
-- Create a low LOD object
local objLowLOD = createObject(5154, x, y, z, 0, 0, 0, true)
-- Assign the LOD object with the Normal object
setLowLODElement(objNormal, objLowLOD)
-- Set the LOD object's parent to the Normal object so it is destroyed together
setElementParent(objLowLOD, objNormal)
-- Set the draw distance for the model we are using for low LOD to maximum
engineSetModelLODDistance(5154, 300)

See Also

Element Functions