Find closest actors

BrundiBrundi Member Posts: 60

In my game I want to have an actor that targets the actor closest to it and In its radius. So if there a couple actors in a row I want it to target the first one.

How would I go about doing that

Thanks, Brandon

Comments

  • TosanuTosanu Member, PRO Posts: 388

    A min() function to compare the results of magnitude() functions on the actor and the targets strikes me as the easiest way to do so. Though i admit i am unsure how to scale that, so that it reads differently when theres 2 targets, or 3, or four, and so on, without manually inputting a new rule for each.

Sign In or Register to comment.