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.
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.
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.