Sorry for posting twice in a short time frame, but I've run into a problem. After a player dies, I have a priest NPC spawn a few feet away that should then walk to the player and ressurect them. Through debugging I can confirm that this works, but my issue is the priest NPC that spawns doesn't know the player entity it's supposed to react with. As a result, my script does not function in a natural case (only when I spawn the NPC in and 'manually' set the target).
I have experimented with getting the nearest player etc..., but that could cause conflict if two players die nearby eachother, and also, it doesn't pick up dead players, which really makes it useless here.
Here is my code for the player's death:
(P.S. I know the event isn't registered there, as it's only a snippet of my player-related script, but the rest is not related to this)
And here is the script for the Ressurection (Priest) NPC:
So I guess my question is: How can I reference the player that spawned a creature independently in the spawned creature's script?
Thanks everyone, I really appreciate the help.