I have some game objects that start in a certain position and are immobile. Upon clicking these objects I would like them to be moved from their current position to a set position and then act as their behavior dictates (move around, jump, etc). I know I can use lerp to accomplish going from the start position to then end position smoothly but I get stuck there (object keeps going back to this position whenever it tries to move away)
Firstly, if you want to move an object to another position with Vector3.Lerp, just use Time.deltaTime (and multiply it with a float to make it faster or slower, see here).
Secondly, you should only put the following in your if-statement
Thirdly, you should set start and end points only once (and not continuously within the Update function).
Put something like this in your OnMouseUp function:
startPoint = transform.position;
endPoint = new Vector3(beginX, beginY, 0);
Lastly, once your object reaches its destination, you might consider setting started to false again.
In your current script you basically told your object to flip back and forth because you always set the object’s position directly while concurrently using the Lerp. I can’t test any of the code right now, but give it a shot.