Help here, my code isnt working..

What i want to do here is when my 1st object is exactly in the position of my 2nd object, the 2nd object will move from the previous position of the 1st object…

kinda stuck in here…

function Update ()

function PositionChanging ()


 var positionA : Vector3 = new Vector3(-1.5, 2, -4.704057);

 newPosition = positionA;

    c2.transform.position = Vector3.Lerp(transform.position, newPosition, Time.deltaTime);

Lerp is going to need to run over the course of many frames or ticks to get a nice movement. See how it works here: Unity - Scripting API: Vector3.Lerp

This also means that you can’t ONLY take action when c1 and c2 are in the same position. Lerp needs to be called EVERY UPDATE as it is moving, so they clearly won’t have the same position after you get it moving.