0

I'm new to Unity. Imagine if I have a box and I want it to move (smoothly) from point A to point B, what is the best way to do this?

I attached a "Move" script to the object, programmed where is point B, and moved it's position (via translate) in each Update until it reached the destination.

But moving the object frame by frame seems tedious.

Is there an easier way to do this? To make objects "fly by wire" (and then stop) ?

vikingsteve
  • 38,481
  • 23
  • 112
  • 156
  • You can use a tweening solution. Using iTween, dotween or leantween (itween is not really good performance-wise), you can force an object to move to a position, with a certain speed, and with only 1 instruction (usually). Of course, you are kind-of forced to move the object frame by frame, but these tweening solutions make the dirty job for you – Alex Ferretti Jun 13 '17 at 07:57
  • 2
    This is where coroutine and `Time.deltaTime` and `Vector3.Lerp` becomes really useful. Plugins such as iTweens is not necessary for this simple task. – Programmer Jun 13 '17 at 08:01

0 Answers0