Vector3 newPos = new Vector3(transform.position.x, posY, transform.position.z); transform.position = Vector3.Lerp(transform.position, newPos, Time.deltaTime * transitionSpeed);