You can use Hide Object and Show object for 3d objects, like this:
`set up computer
sync on:sync rate 60
hide mouse
`make box
make object box 1,10,10,10
KeyPress=0
`main loop
do
AngleY#=Wrapvalue(AngleY#+0.5)
yrotate object 1,AngleY#
`if user presses return then hide/show the box
if returnkey()=1 and KeyPress=0
KeyPress=1
`check to see if box is visible
if object visible(1)=1
`hide object
HIDE OBJECT 1
else
`show oject
SHOW OBJECT 1
endif
endif
if scancode()=0 then KeyPress=0
sync
loop
in 2D make the box the same colour as the background
hope this helps
[EDIT] oops guess Mentor beat me at typing again
[/EDIT]
Part of solving the problem is actually noticing that the problem is there in the first place