Get Vector3 position of player?


I have a first person controller on my scene named “Player”. In my script I am trying to get the position of the player in Vector3. How exactly do I do this?

This is what I tried:

var playerObject = GameObject.Find("Player");
var playerPos:Vector3 = playerObject;

This will give me an error: Cannot convert ‘UnityEngine.GameObject’ to ‘UnityEngine.Vector3’.

var playerPos:Vector3 = playerObject.transform.position;