Answer the question
In order to leave comments, you need to log in
How to move an object by several units?
I have a cube, the task is to move it exactly 5 units along the X axis when you press the key, just do it smoothly, through transform.Translate
I figured out the smooth movement, but how can I move it by a few units then?
I will say right away that MoveTowards will not work, the object always moves up along the Y axis (let's call it a runner) so moving between two points does not suit me
Answer the question
In order to leave comments, you need to log in
transform.position = Vector3.Lerp(startPosition, endPosition, .1f);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question