Search Unity

Vector3 Lerp, I have Point A, Point B and the current position between them, trying to find T

Discussion in 'Scripting' started by stefanplc, Feb 1, 2019.

  1. stefanplc

    stefanplc

    Joined:
    Feb 21, 2015
    Posts:
    82
    Hi there,

    I know that using Vector3.Lerp you can find a Vector3 between 2 Vector3 by specifying the interpolant T (between 0 and 1). In my case I already know the Vector3 between the 2 Vector3 and I need to find the interpolant T instead. How can I do that?

    Thank you!
     
  2. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    994
  3. stefanplc

    stefanplc

    Joined:
    Feb 21, 2015
    Posts:
    82
    I'll give this a try, thank you!