ObjectInstance

Family: 3D · 2 forms

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) → integer
2
ObjectInstance(newObjectID integer, objectID integer)

Parameters

NameTypeIn forms
objectIDintegerall
newObjectIDinteger2

What each form returns

1ObjectInstance(object)integer
2ObjectInstance(1, object)nothing

Example · generated

Form 1, the command hands back the id

object = LoadObject("assets/media.obj")DO  Print(ObjectInstance(object))  Sync()LOOP

Form 2, you choose the id yourself

object = LoadObject("assets/media.obj")ObjectInstance(1, object)DO  Sync()LOOP

LoadObject 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.

286 commands in 3D