- Home /
Question by
ferari718 · Jun 26, 2018 at 09:21 PM ·
vector3unity4vector3.lerp
How do I change this code from a new Vector3 to Vector3.Lerp?
How can I change this code from a new Vector3 to Vector3.Lerp? I want the transition of the positions to be smoother. transform.position = new Vector3(transform.position.x - offset, transform.position.y, transform.position.z);
Comment
Best Answer
Answer by deneme09 · Jun 26, 2018 at 09:44 PM
Try this
float speed = 1.0f;
Vector3 target = transform.position - (transform.right * offset);
transform.position = Vector3.Lerp(transform.position, target, Time.deltaTime * speed);
Your answer
Follow this Question
Related Questions
Camera Controller to Player Position Conflict 1 Answer
MoveTowards won't translate on the y axis and lerp leaves character jittering in mid-air 0 Answers
Getting Vector3 in between two given Vector3 after given Distance. 2 Answers
Unity smooth following 2D camera not working properly on different resolutions 0 Answers
Moving two game objects in To and Fro motion continuously? 2 Answers