What it does
ObjectInstance takes objectID (an integer), and answers an integer. That is the first of 2 forms. objectID is the id of a 3D object, the one LoadObject returned: it is how the call knows what to act on.
Syntax
1
ObjectInstance(objectID integer) → integer2
ObjectInstance(newObjectID integer, objectID integer)Parameters
| Name | Type | In forms |
|---|---|---|
| objectID | integer | all |
| newObjectID | integer | 2 |
What each form returns
| 1 | ObjectInstance(object) | integer |
| 2 | ObjectInstance(1, object) | nothing |
Example · generated
Form 1, the command hands back the id
object = LoadObject("assets/media.obj")DO Print(ObjectInstance(object)) Sync()LOOPForm 2, you choose the id yourself
object = LoadObject("assets/media.obj")ObjectInstance(1, object)DO Sync()LOOPLoadObject is there to give the call something to act on; ObjectInstance is the line that matters. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.