Issue with transform arrays

Let me preface that I understand this is likely a very very basic issue and I wish I didn’t feel the need to ask this here but as it stands I have looked through a lot of the documentation, I’ve looked at various examples, I’ve googled through dozens of solutions only to come close but not quite come to any concrete answer that I’m looking for. So here I am to try and ask for some ones help in the matter.

I’ve been having a ton of problems trying to write this script. At the moment I call for all the children within any objects tagged under “Allied_Units” and once it obtains those transforms it passes it into an array and is supposed to grab the closest option but when I run the script, I’m not even sure that it is finding anything at the moment. I’ve largely used code from the example scripts so I’m unsure if there is an aspect that I am missing but I’ll post the script below with the error as well.

Any help would be greatly appreciated and I thank you for taking the time to read through this request.

Hi

If you are only looking for the closest path, you should check mp.vectorPath, not mp.vectorPaths.
It also looks like you are requesting a path from a point to itself, leading to a path of length 0.

This helps a ton, thank you, not sure how I missed the path directing to itself but I’ll give this a look and adjust everything. Thank you so much for the time!