FANDOM



This command will clone the specified object and make an exact duplicate of it.

Syntax
CLONE OBJECT Object Number, Source Object
CLONE OBJECT Object Number, Source Object, Share Original Data
Parameters
Object Number

Integer
The destination object number, where the cloned object will be created. Source Object Integer
The source object number, where the cloned object will be copied from. Share Original Data Integer
Set this value to one, to allow the animation data to be shared from the source object.

Returns

This command does not return a value.

Description

Cloned objects do not share any data from the source object, and is not dependent on whether the source object exists after the cloning has taken place. This differs from instancing, where the destination object is dependent on the source objects existence. The only time a cloned object is dependent on the source is when then optional parameter to share animation data is used. You may wish to share animation data because it can easily consume megabytes of memory, and cloning many animated objects for your application might cause an unnecessary drain on system resources.

Example Code
sync on : sync rate 60 : hide mouse:cls 0

autocam off

ObjectNumber=1

SecondObject=2

make object cone ObjectNumber,10

xrotate object ObjectNumber,90

fix object pivot ObjectNumber

color object ObjectNumber,rgb(0,255,0)

position object ObjectNumber, 0,0,0

clone object SecondObject,ObjectNumber

color object SecondObject,rgb(255,0,0)

position object SecondObject,25,0,25

while mouseclick()=0

set cursor 0,0

position camera object position x(SecondObject),object position y(SecondObject),object position z(SecondObject)+20

point camera object position x(SecondObject),object position y(SecondObject),object position z(SecondObject)

sync

endwhile

delete object ObjectNumber

delete object SecondObject

end