Project Akemi - Prototype | Incomplete AI MoveTo node/invalid target pin

I want my roaming NPC to run towards another NPC—in the world—when it spots the player.

Below I have a blueprint that should work in theory, as in, it shouldn’t relay on it’s PawnSensing to run towards the authority NPC, it should just know where it is.

I’m only missing that Object pin in Cast to PB_Authority, I don’t know how to fix.

Imagine there are 10 authorities. How does the citizen know which one? How do they decide?

That’s a good question, I don’t know.

I guess I would need some reference to a particular BP_Authority, I just don’t know what node that would be.

So far I’ve tried adding Add Child Actor Component: Actor Class BP_Authority node but that gave me the “does not inherit” error.

I’ve also tried giving it the Pawn pin from On See Pawn (Peripheral)


but I guess that also doesn’t tell it which BP_Authority to go to; it didn’t work.

I’ve also tried detaching Cast To BP_Authority and just have Call Authority connect to AI MoveTo directly (white wire).

Maybe my Blueprints are all wrong and should approach this a different way.

What if I had a Boolean—set to FALSE by default—that becomes TRUE when player is spotted and a second On See Pawn that always fails unless Boolean was set to TRUE? Is there a simpler solution?

You’re the designer, how would you like it to work? Ignore the technicalities for now. Which cop does the citizen run to? The closest one? The tallest one? The toughest one? The handsome one? The favourite one? A random one? Perhaps there is only one?

There sure is a misunderataning here regarding what Cast To does. It does not find an actor - that’s your job. Cast is just a conversion; in order to cast, you need an instance of the authority. So, which one do we run to for help? What makes the citizen choose one over another? Chances are we do not even need to cast anything.

As of right now, I want my citizen to run to the only cop in the world. I’ll later worry about it running to the closest cop it can see.

I still haven’t found the answer, every attempt to find either a node to fill in the Cast To requires another reference I don’t have, or every other attempt to replace the Cast To node left me wondering how to even use the node.

I’m turning Google and other forums upside down at this point trying to find an answer.

You were right, I found a solution on a reddit post that uses the Get All Actors of Class node, a really cleaver solution.

Now clearly this is a rough solution and can definitely be approved upon. So far I’ve added the LENGTH node, now I just need it to collect the distance between Self and all BP_Authority and GET the lowest value.

If you want it to work via proximity:

  • sphere overlap actors instead of Get All Actors of Class - you immediately get results that are already within certain distance
  • for all your sorting needs:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.