transform.position error

Hi,

I'm trying to get the position of an object with..

var objectpos : Vector3 = transform.position;

but I get the error "Argument Exception: You are not allowed to call get_transform when declaring a variable. Move it to the line after without a variable decleration."

I dont really understand how to solve this, can anyone help?

thanks

I assume you're putting this in the start of your code? I've run into this error before and it really shouldn't affect anything, but you can easily get around it by switching your code into two lines.

var objectpos : Vector3;
objectpos = transform.position;

Cheers.