Copy position into var without updating every frame

Hello everyone,

I try to copy the Position of my object to a variable at the start of the function. But my problem is that every frame the variable gets the new postion copyed.

that was the code

var objectstart : float = object.transform.position.x;

How can I get this out of the update progress?

Best regards


Take it out of the Update function.

Take it to Start function