0
\$\begingroup\$

I'm moving a Game Object in unity from point A to point B no matter what the original position of the Game Object is.

Let us suppose that I have a Game Object at (0, 0, 0).

But I want to move that Game Object from (1, 1, 1) to (2, 2, 2).

How can I do this in C# ?

\$\endgroup\$
2
\$\begingroup\$

Simply set the object's Transform.position to Vector3.Lerp(Vector3 A, Vector3 B, percent completion

\$\endgroup\$
  • \$\begingroup\$ Why not just set it? I don't think he's looking for Lerp. \$\endgroup\$ – Ben Apr 19 '15 at 5:51
  • \$\begingroup\$ Its a bit ambiguous but I actually read it that he does want to lerp over time from A to B \$\endgroup\$ – Alan Wolfe Apr 20 '15 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.