Need help with function...

Blitz3D Forums/Blitz3D Programming/Need help with function...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Odd, it seemed to work well in our tests...

Anyway, this is what I came up with out of nowhere:

Function AttachMesh(MeshToAttach,Mesh)
	
	For Children = 1 To CountChildren(MeshToAttach)
		Child = GetChild(MeshToAttach,Children)
		For OtherChildren = 1 To CountChildren(Mesh)
			OtherChild = GetChild(Mesh,OtherChildren)
			If EntityName(Child) = EntityName(OtherChild) Then
				EntityParent(Child,OtherChild)
				Exit
			EndIf
		Next
	Next
	
End Function


But, it fails at the first line, saying entity does not exist...when in fact I have passed the two entities to the function. Both are loaded as animated meshes to preserve the bones. Seems simple enough, but I get the feeling I'm missing something...