SetObjectModel: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
-- Spawn a weed object at 1000.0, 1000.0, 100.0 | |||
let object = CreateObject(64, 1000.0, 1000.0, 100.0) | |||
-- Change the spawned weed object to a tree | |||
SetObjectModel(object, 66) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{ObjectFunctions}} | {{ObjectFunctions}} |
Revision as of 11:33, 27 September 2020
Description
This function changes the model of the created object. This function calls OnObjectModelChange event on client side.
Syntax
SetObjectModel(objectid, modelid)
Parameters
- objectid
The object identifier. - modelid
The model identifier for which object to spawn.
Return Value
- Returns true on success.
Example
-- Spawn a weed object at 1000.0, 1000.0, 100.0
let object = CreateObject(64, 1000.0, 1000.0, 100.0)
-- Change the spawned weed object to a tree
SetObjectModel(object, 66)
See also
- CreateObject
- DestroyObject
- IsValidObject
- GetObjectCount
- GetObjectModel
- IsObjectStreamedIn
- EnableObjectStreamEvents
- SetObjectStreamDistance
- SetObjectLocation
- GetObjectLocation
- SetObjectRotation
- GetObjectRotation
- SetObjectScale
- GetObjectScale
- SetObjectAttached
- SetObjectDetached
- IsObjectAttached
- GetObjectAttachmentInfo
- IsObjectMoving
- SetObjectMoveTo
- StopObjectMove
- SetObjectRotateAxis
- GetObjectModelCount
- GetObjectMass
- GetStreamedObjects
- GetObjectBoundingBox
- GetObjectSize
- EnableObjectHitEvents
- SetObjectEditable
- SetObjectOutline
- SetObjectColor
- SetObjectEmissiveColor
- SetObjectTexture
- SetObjectAnimatedTexture
- SetObjectCastShadow
- SetObjectDimension
- GetObjectActor
- GetAllObjects
- SetObjectModel