findchild and collisions

Blitz3D Forums/Blitz3D Programming/findchild and collisions

Ello!

I have a single level .3ds file and I want to findchild different bits of it to add collisions. Problem is, it doesn't seem to be working ... anybody got any idea what I'm missing here?

I load the mesh using:

levelmesh=LoadAnimMesh("level1.3ds")

and use the following to add collisions to the 'track', which is named 'parta,partb and partc'. I know it's finding the children ok and I can even remove the if/name condition without success, which you would think would add collision to all children.


Const playercol = 1
Const levelcol = 2

Function initcollisions()

; Set up collisions for level

	For e = 1 To CountChildren(levelmesh)
		
		ent= GetChild(levelmesh,e)
	
		If Left$(EntityName(ent),4) = "part" 
			EntityType ent,levelcol
			EntityPickMode ent,2
		EndIf
		
	Next
	
	Collisions playercol,levelcol,2,2

End Function



Any help would be appreciated. Thanks all! :)