Here is one that doesn't
...and my loading code...
I start by loading the object (this stays hidden):
Cube=1
load object "Bloks/Cube.x",Cube : GOSUB _loading_bar
position object Cube, 0,-10,0
hide object Cube
AddCube=1
Then I clone the object as shown here:
_ADD_BLOK:
if AddCube>0 then Blok=Cube : AddCube=0 : MinX#=.5 : MinY#=.5
if AddArch>0 then Blok=Arch : AddArch=0 : MinX#=1 : MinY#=.5
if AddCyl1>0 then Blok=Cylinder1 : AddCyl1=0 : MinX#=.5 : MinY#=.5
if AddCyl2>0 then Blok=Cylinder2 : AddCyl2=0 : MinX#=.5 : MinY#=1
if AddRect1>0 then Blok=Rect1 : AddRect1=0 : MinX#=1 : MinY#=.5
if AddRect2>0 then Blok=Rect2 : AddRect2=0 : MinX#=1 : MinY#=.25
if AddRect3>0 then Blok=Rect3 : AddRect3=0 : MinX#=1.5 : MinY#=.25
if AddSemi>0 then Blok=SemiCircle : AddSemi=0 : MinX#=.5 : MinY#=.5
if AddTri1>0 then Blok=Triangle1 : AddTri1=0 : MinX#=.7 : MinY#=.25
if AddTri2>0 then Blok=Triangle2 : AddTri2=0 : MinX#=1 : MinY#=.275
GOSUB _GET_OBJ
CLONE OBJECT Obj, Blok `this would be Cube (Object 1)
position object Obj, campntX#,campntY#+MinY#,campntZ#
texture object Obj,0,RND(7)+5 `a random selection of coloured textures
texture object Obj,1,2 `the shade texture
set object effect Obj,1 `Evolved's shader
HeldObj=Obj
NICE WAIT NO INPUT
ghost object on Obj,4 `the object is unghosted once positioned in scene
p=pick object(screen width()/2,screen height()/2,1,100000)
if p<>2 and p<>23 then pd#=get pick distance()
move camera pd#-5 `just moves the camera in on the object inserted
return
...and finally the object is placed:
if mouseclick()=1 and timer()>=st+4000
st=timer()
ghost object off HeldObj
set shadow shading on HeldObj,-1,10,shader
phy make rigid body dynamic convex HeldObj
HeldObj=0
Zrot#=0
inc BlocksInScene
nice wait no mouse
endif