AI to run away.

Hello ladies and gentle fish, at the moment i have a nice bit of code that makes the AI run towards the player, my question is , can I invert this to make my AI run away from me?

var player: Transform;

function Start(){
    player = GameObject.FindWithTag("Player").transform;

function Update()
	GetComponent(NavMeshAgent).destination = player.position;

You could try getting the direction in which you want to move:

var dir = player.position - transform.position;

And then multiply that direction for a reasonably high value and set that as the destination (being careful to adjust the center of the coordinates system to the AI’s position):

GetComponent(NavMeshAgent).destination = transform.position + dir * Mathf.Infinity;