Custom Targetting system won't work

hi, I am new to GDevelop. I am trying to make a custom targetting system for my AI which uses team stats, but it does not work.

I tried debugging it, and have found that it works when only the player is in the targetables group.

in another test, I added a variable which resets every loop, and adds by one for every found targetable, and it was stuck at one, so I either messed up the variable setters, or it is only selecting one target, and then ending.

also this is an external event which the main scene calls.

here is my code:

any help would be appreciated.

I’m assuming what you’re trying to do is find the team’s targetable object that’s closest for each team’s pathfinder object?

If so, you could use:

1 Like

Hello, thanks for reaponding I updated my code to this:


but it still does not work.

I am sorry I typed that in a rude way and typo’d. is it possoble tp edit comments?

I can’t see what’s rude about your response. No apologies needed :smiley:

Why are you using not equal when comparing Pathfinder.Team and Targetable.Team? Shouldn’t is be equal to (‘=’)?

1 Like

no, I am trying to make it find enemies to target

So targets from another team? What does it do currently - where do the pathfinder objects move to?