URigHierarchy::GetSpawnIndex

Returns the spawn index of an element / component given its key.