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\$

1 Answer 1

2
\$\begingroup\$

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

\$\endgroup\$
2
  • \$\begingroup\$ Why not just set it? I don't think he's looking for Lerp. \$\endgroup\$
    – Ben
    Commented Apr 19, 2015 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
    Commented Apr 20, 2015 at 1:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .