HI all,
I have this script which I am using to try and move an object towards another object when I collide with it; but it is coming up with the error in the title?
Any suggestions?
Thanks!
#pragma strict
var target : Transform;
var speed;
function Start () {
}
function Update () {
}
function OnTriggerEnter(other : Collider) {
if (other.gameObject.tag == "StrawBerry")
{
// var step = speed * Time.deltaTime;
other.position = Vector3.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
}
}