removeObject()
Purpose
Remove a 3D object
Description
Remove a 3D object previously placed in the screen buffer by place object. The handle becomes invalid after removal and should not be used
Syntax
removeObject( handle )
Arguments
handle variable which stores the placed 3D object
Example
cb = loadModel( "Kat Deak/Colin" )
pointLight( { 0.5, 1.3, 2 }, white, 4 )
setAmbientLight( { 0.5, 0.5, 0.5 } )
colin = placeObject( cb, { 0, 0.295, 0 }, { 1, 1, 1 } )
placed = true
setCamera( { 0, 10, 10 }, { 0, 5, 0 } )
animID = 6
animlength = animationLength( colin, animID )
animframe = 0
loop
clear()
c = controls( 0 )
if c.x and placed then
removeObject( colin )
placed = false
endIf
if c.a and !placed then
colin = placeObject( cb, { 0, 0.295, 0 }, { 1, 1, 1 } )
placed = true
endIf
if placed then
animframe = animframe + 1/60
if animframe >= animlength then
animframe = 0
endIf
updateAnimation( colin, animID, animframe )
endIf
drawObjects()
printAt( 0, 0, "Press X to remove" )
printAt( 0, 1, "Press A to place" )
printAt( 0, 2, "Frame: ", animframe )
update()
repeat```
![](/help/images/robotImg.png)
**Associated Commands**
[drawObjects()](/help/view/drawObjects), [loadModel()](/help/view/loadModel), [objectPointAt()](/help/view/objectPointAt), [placeObject()](/help/view/placeObject), [rotateObject()](/help/view/rotateObject), [setObjectMaterial()](/help/view/setObjectMaterial), [setObjectPos()](/help/view/setObjectPos), [setObjectScale()](/help/view/setObjectScale)