Object selection

I want to make some kind of a smart npc that always goes twards the biggest object in a scene an example if you have 2 boxes it will go the largest one but if I change the size of them during gameplay it will change direction and go to the new big box farthermore if they have the same size at the beginning of scene it won’t move but in case he started moving towards one than I change the other making them equal it will
continue with the old path I hope you understand what I want to do I didn’t write any events to start with because I really don’t know how to deal with this

It depends on how you decide which object is the largest. I tested the concept with scale. You could use height and/or width.

This uses 2 objects, one named Enemy and one named Target. It uses 2 variables. A scene number variable named “Largest” and an Enemy object Boolean variable named “IsMoving”.

Since I was testing the scale, I had it assign random scale values.