How to make a Slender type AI?

Hi guys, this is my first post here and basically I’m attempting to create an AI that acts very similar to that of Slenders’ AI so when my enemy mesh spots me, it chases me but I want it to appear randomly and when the player is out of its line of sight, it disappears waiting to reappear in a new location. Making the AI isn’t much of an issue its just the appearing at random bit and disappearing when out of sight that is the annoyance.
Any help?

Do you have Skype? If you do, add me and I can help you with this.
Skype: mrmcswagboat

Hey ,

Regarding the appearing and disappearing at random when there’s no line of sight, I suggest you to use a dot product (make sure the vectors used are normalized) to get the angle between the player and the AI, and test whether the AI is in your field of view or not.

I attached an example where after the player is warned, something bad happens once they look behind them.

Cheers