Thanks, Tindust--

That version produces an error on this line:

if(result){vec_set(my.pos,vector(target));}

And I don't understand why you have temp_z = 300. I would think temp.z = result.