Question by
lastnoob765 · May 06, 2021 at 02:00 PM ·
vector3lerp
Vector3 lerp continues forever?
i want to make a wall come out of the ground and used code like this:
private Vector3 currentPosition;
private Vector3 targetPosition;
public float speed;
public bool isEnabled = false;
public float currentY;
void Start()
{
currentPosition = transform.position;
targetPosition = new Vector3(transform.position.x, transform.position.y + 4f, transform.position.z);
}
void Update()
{
transform.position = Vector3.Lerp(currentPosition, targetPosition, 0.5f * Time.deltaTime);
}
and it just continues forever,so what am i doing wrong?
Comment
Your answer
Follow this Question
Related Questions
gameobject position lerp 0 Answers
Lerp on the every 3 * n cycle does some wierd thing. 0 Answers
DOTween sequence snapping 0 Answers
Quaternion lerp slowing down movement? 1 Answer
Lerping between points? 1 Answer