Unity cannot use Vector3 error = confusion

I am trying to get it so when I reach a barrier, the object bounces back. This is the first time I have really used Lerp and I am a bit confused. Thanks a bunch.

Error: (20,47): It is not possible to invoke an expression of type ‘UnityEngine.Vector3’.

//Original Object
    var object : GameObject;
 
//Object position + end poition modified
    var objectPos : Vector3;
    var objectEnd : Vector3;
 
//Controllers
    var duration : float = 1.0;
    var startTime : float;
 
//Barriers
    var topPos : float = 0;
    var rightPos : float = 5;
    var leftPos : float = 11;
    var bottomPos : float = 16;
 
function Update () {
 
    if (object.transform.postion.x == rightPos) {
 
       objectEnd.transform.position.x = 4.797853;
 
       object.transform.position = Vector3.Lerp(objectPos, objectEnd(Time.time- 
startTime) / duration);

       }
 
    }

Your error is due to line 24 which is missing a comma and therefore objectEnd is being consider as an attempt to execute a function call on something that is not a function.

object.transform.position = Vector3.Lerp(objectPos, objectEnd, (Time.time- 
startTime) / duration);

Another potential issue is line 20. Having two floats compare to the same values won’t happen very often if the one or both of the numbers are calculated. Consider changing it to:

if (object.transform.postion.x >= rightPos) {