How can I make characters call the player when they are idle?

Ok so I’m going to explain with more detail here…

What I mean is like a scene where there’s some kind of companion and he is guiding you somewhere but the player stays idle in a very open place where anything could happen so the companion starts calling the player ( the name of the character that the player is playing as ) so like for example :

(Player) is following the (Companion), suddenly they stop because their idle so the (Companion) starts calling the (Player) name, and make it so that if the (Companion) has a weapon he/she will actually take the gun out to protect the (Player) while he/she is away.

This sounds a bit complicated but I’ve seen most games do it, I can’t really give examples because I don’t remember the names of the games but I think you understood, I just added that little part that makes it more realistic/smart for survival type games.

Another option you could do besides Nick Jacksons good suggestion is to keep track of player controller input. If you stop receiving input from the controller for a certain period of time, have the companion act accordingly. It’s a bit more complicated to implement then just using the large sphere collider but would be a bit more dynamic.

How I would do this is have a Boolean and a timekeeper function, the boolean gets flagged everytime their is no input from the controller, when its on, the timekeeper starts ticking (Which would take note of when it started, and then just keep checking the datetime of the computer/console and diff the values to see how long its been). You could have some global triggers/interfaces that will then get shot a signal when the timekeeper hits the mark.

Create a large Sphere Collider on the NPC. Every time the player leaves the sphere, you can initiate your “calling” routine. Whatever it may be.