I have been playing around with the GKRTree but I am unable to make it work properly. It would be great the have a working example of adding, removing and searching elements
https://developer.apple.com/reference/gameplaykit/gkrtree
I am bit unlear on how exactly the boundingRectMin and boundingRectMax should be created when adding an element, and when searching for them.
My idea is to add all enemies in the tree and using the position of my main character, find which enemies are around me.