EntityColided?

Blitz3D Forums/Blitz3D Beginners Area/EntityColided?

Im new to 3D and I have been trying to figure out how to make 2 cubes collide in some way.
Graphics3D 800,600

SetBuffer BackBuffer()

camera=CreateCamera()
CameraViewport camera,2,0,800,600

light=CreateLight()

cube=CreateCube()
PositionEntity cube,0,0,5

cube2=CreateCube()
PositionEntity cube2,0,2,5

While Not KeyHit(1)

If KeyDown(200) :MoveEntity cube,0,0.05,0:EndIf 
If KeyDown(208) :MoveEntity cube,0,-0.05,0:EndIf
If KeyDown(203) :MoveEntity cube,-0.05,0,0:EndIf
If KeyDown(205) :MoveEntity cube,0.05,0,0:EndIf

If EntityCollided(cube,cube2) Then PositionEntity cube2,Rnd(-2,2),Rnd(-2,2),5 

TurnEntity cube2,0,.5,0

UpdateWorld
RenderWorld

Flip

Wend
End


If EntityCollided(cube,cube2) Then PositionEntity cube2,Rnd(-2,2),Rnd(-2,2),5
That is probably way wrong, but there was no example in the command reference.
I was trying to make it so when you collide with the spinning cube it will be randomly placed on the screen, but that didn't work. How do you make 2 cubes collide?

-Thanks