After searching for a solution to my problem, I’m finally relenting and asking my first question here. It’s not really a Unity specific question, more of a mathematical question, but I’m hoping someone can help.
What I’m trying to do is write a script that moves an object to one point from another point, but give it a little elasticity at the end of its journey. Sort of like a little wobble back and forth after it reaches the destination.
Vector3.Lerp works fine for getting the object from one point to another, but that doesn’t give me the elasticity at the end that I want. If there’s an easy way to accomplish this, I’m all ears, but my current implementation idea is to locate a point beyond the destination in the same direction of travel, and use lerp and an ever decreasing variable to add the back and forth travel that I’m looking for. Thus Vector3.Lerp(origin, destination, 1.0) would put me at the overshoot, whereas Vector3.Lerp(origin, destination, 0.95f) would put me at my true destination). I hope that makes sense.
Anyway, all of this to get to my question. I’m not familiar with Vector math, and it’s been well over a decade since I’ve done any math beyond algebra (I usually do business software), so I’m not aware of how to find a point beyond my destination. What is the process of taking an origin vector and a destination vector and finding a point that is X units past the destination on the same line?
Thanks in advance for any help you can offer me.