# Sorting actor array by Field, returns a sort organized by class, then field

**URL:** <https://forums.unrealengine.com/t/sorting-actor-array-by-field-returns-a-sort-organized-by-class-then-field/342941>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [January 3, 2016, 12:05am UTC](https://forums.unrealengine.com/t/sorting-actor-array-by-field-returns-a-sort-organized-by-class-then-field/342941 "2016-01-03T00:05:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_84e009961](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_84e009961](https://forums.unrealengine.com/u/anonymous_user_84e009961)\
**Post date:** [January 3, 2016, 12:05am UTC](https://forums.unrealengine.com/t/sorting-actor-array-by-field-returns-a-sort-organized-by-class-then-field/342941/1 "2016-01-03T00:05:06Z")

</div>

I have borrowed the sorting code from the wiki page here:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

and when using this custom blueprint node to sort an array of ‘AI\_Char’ based on distance(float), it returns a sort of subclass, then distance. The array that I am plugging is of type AI\_Char with multiple subclasses of AI\_Char.

I have looked over the source of the wiki page and I’m unsure as to why it is grouping my actor’s subclass. Any tips would be appreciated =D.

Class tree:  
AI\_Char  
-AI\_Friendly  
–AI\_No\_Move  
-AI\_Enemy  
–AI\_Melee
