What is the best approach of "stalking" a player?

If some of you have played Isle or Identity Fraud, you’ll understand what I mean.
If you don’t, Isle and Identity Fraud both have an entity that is named Stan. The entity appears around the map behind players until they look behind, then disappearing. It is like stalking someone, you’re going about your business then you get a sudden urge to look behind you, seeing something then it disappearing.

My best approach really is to just raycast around the character, detect if its far enough (so the entity doesn’t like spawn RIGHT next to the character) then return the spawn position provided. Which works well, however I want to know if this is not the only method.

Is there any more advanced methods to mine? If so, which method is the best?

1 Like

what if there were already decided positions where the stan guy spawns (lets say on every corner/turn), and every amount of time he spawns in one of those positions (lets say the position is decided by how close the magnitude is from a certain number), if the player turns around do whatever is supposed to happen, else he just switches to another position if the player gets too far, however with this method it will get boring over time.