Working with Collisions and Meshes

Blitz3D Forums/Blitz3D Beginners Area/Working with Collisions and Meshes

If count% = 1 Then
fruitarray(count%)\fmodel% = LoadMesh("../media/cherry.b3d") ;Load initial model from b3d file.
meshx# = EntityX(fruitarray(count%)\fmodel%,True) ;get initial x,y,z coords for model.
meshy# = EntityY(fruitarray(count%)\fmodel%,True)
meshz# = EntityZ(fruitarray(count%)\fmodel%,True)
RotateMesh(fruitarray(count%)\fmodel%,60,30,0) ; Rotate the mesh after loading it.
FitMesh(fruitarray(count%)\fmodel%, meshx#, meshy#, meshz#, 20.0, 20.0, 20.0, True) ;stuff it in a box
EntityRadius(fruitarray(count%)\fmodel%,20.0) ; setting the entities collision radius to 20.
fruitarray(count%)\number% = count%
fruitarray(count%)\name$ = "cherry"
NameEntity fruitarray(count%)\fmodel%, "cherry" ;entityname for use in collision and points etc..
EndIf

Here is how one of the fruit models is setup.. with the fitmesh it works... though I still get a ghost fruit item.. for some reason.. I have 7 models in total setup inside a for loop.