Operator '-' cannot be used with a left hand side of type 'UnityEngine.Transform' and a right hand side of type 'UnityEngine.Vector3

ok so i script a javascript for my AI and they say that

Assets/scripts/AI.js(20,55): BCE0051: Operator ‘-’ cannot be used with a left hand side of type ‘UnityEngine.Transform’ and a right hand side of type ‘UnityEngine.Vector3’.

what can i do
Thanks

private var dirToMain:Vector3;

function Update () {

dirToMain = GameObject.Find("golem").transform - transform.position;
	dirToMain.y = 0;

...

there is more code after that but there is no bug in it

The error message says you can’t subtract a Vector3 from a Transform. So how about:

dirToMain = GameObject.Find(“golem”).transform.position - transform.position;

?