Object Disappearing when comes close to player.

Hello. I need your guys help.
Well… i have made a zombie model, and all it’s animations are done. But i want a zombie to run up to me, then it quickly disappears into like a smoke particle effect. So basically when the zombie is in like a 2 meters range of the player it will disappear.
I’m okay with some code, i’m just new to Unity. Sorry.
But if you could just give me an example of how to do this, it would be great.

Thanks !

Attach a JavaScript Script to your player with this code. Welcome to the forums, and be sure to mark this answer as correct if it solves your problem.

var zombieT : Transform;
var zombie : GameObject;
var vanishDist = 2.00;

function FixedUpdate ()
if (zombie)//If he still exists
    var dist = Vector3.Distance(zombieT.position, transform.position);//How far is he

    if (dist < vanishDist)//If he is close enough
	Destroy (zombie);//Make him disappear