P
P
piffo2020-04-25 20:18:44
C++ / C#
piffo, 2020-04-25 20:18:44

How to echo Vector3.Lerp?

I move my object from point kop to point kop1.

private void FixedUpdate()
    {
        this.gameObject.transform.position = Vector3.Lerp(kop, kop1, progress);
        progress += step;
    }

As soon as my object has reached the kop1 point, I want to return it to the kop point, so that again it goes to the kop1 point and so on indefinitely.
The object returns to point kop, but stays in place and does not move to point kop1. Why? And how can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
2
2CHEVSKII, 2020-04-25
@piffo

Well, you will reset progress .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question