Getting a possible parentwithout getting an error

Blitz3D Forums/Blitz3D Programming/Getting a possible parentwithout getting an error

You keep on finding the parent of the entity passed to the function...Do it like this:
Function GetTopOfTree(child)
	
	parent = child
	
	par = GetParent(child)
	While par
		parent = par
		par = GetParent(parent)
	Wend
	
	Return parent
	
End Function