How would I create this scrip/ai code?

(I’m using Unity indie) Ok, I’m a total coding noob. Been using Unity for about a month now and it still confuses me. Basically, I want to create a script/ai code which would allow a model of a person to appear in one place from far away. You head towards it, turn a corner (thus blocking the model from view, during which time it dissapears) and the player is wandering around thinking “Where did that person go?”. As I said I’m a total script noob so I don’t know if this would be easy or hard to create. Any response would be a massive help. Thanks.

As this would take a whole page I will just give you the pseudo code. ALso, it is agood way to learn.

place a trigger box-box collider with IsTrigger and no renderer.

then use Unity - Scripting API: Collider.OnTriggerEnter(Collider)
This will trigger the instantiation Unity - Scripting API: Object.Instantiate of your enemy.

Now you can use the same process to make your guy disappear. You place a trigger box and destroy your enemy Unity - Scripting API: Object.Destroy.

Other way (since you want to learn) is to instantiate the enemy in the start function, Start is only launched when the scene starts before you can play and you deactivate the enemy.

function Start()
var enemy=instatiate
enemy.activate = false;

then when you enter the trigger you activate it with

enemy.activate = true;

There you go. Any questions, go ahead.

You should look into scripting reference OnBecameVisible and OnBecameInvisible this should provide you with required functions to extend by your need.