Move from position 1024 to position 240 along z-axis (transform.Translate)

How do you use the following function to move an object from one point to the next in slow motion?

Currently, my script looks like the following:

function Update () { //Move the fake ship forward from point 1024 to 240. transform.Translate(Vector3.forward * Time.deltaTime); }

1 Answer

1

http://unity3d.com/support/documentation/ScriptReference/Vector3.Lerp.html

DaveA, thanks for the tip. I don't quite know how to start at 1024 and end with 240 using: var start : Transform; var end : Transform; function Update () { transform.position = Vector3.Lerp(start.position, end.position, Time.time); }

start.position.z = 1024; end.position.z = 240;