I am trying to move one object to another object in my game. I have a function that does this when I hold down the “1” button on my keyboard. However I have to go into unity and pick the start object and the end object. Is there a way to define the start and end object in the script?
var start : Transform;
var end : Transform;
function Update () {
if (Input.GetKey("1")){
transform.position = Vector3.Lerp(start.position, end.position, Time.time);
}
}