Ошибка CS1501: отсутствие перегрузки для метода «Lerp» принимает 6 аргументов
Код, который выдает ошибку:
Код: Выделить всё
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LerpMovement : MonoBehaviour
{
private Vector3 endPosition1 = new Vector3(2.3f, 2.5f, 0);
private Vector3 endPosition2 = new Vector3(2.3f, -2.5f, 0);
private Vector3 endPosition3 = new Vector3(-2.3f, -2.5f, 0);
private Vector3 endPosition4 = new Vector3(-2.3f, 2.5f, 0);
private Vector3 startPosition;
private float desiredDuration = 3f;
private float elapsedTime;
[SerializeField]
private AnimationCurve curve;
// Start is called before the first frame update
void Start()
{
startPosition = transform.position;
}
// Update is called once per frame
void Update()
{
elapsedTime += Time.deltaTime;
float percentageComplete = elapsedTime / desiredDuration;
transform.position = Vector3.Lerp(startPosition, endPosition1, endPosition2, endPosition3, startPosition, percentageComplete);
}
}
Не совсем понимаю, что не так с кодом.
Подробнее здесь: https://stackoverflow.com/questions/790 ... -arguments