I want a character to launch a missile at a foe, and I'm using a small missile mesh to get from one to the other. Now, if the character isn't facing the foe directly, I want the missile to fire out straight away from the character a bit before arcing toward the foe.
My original thought was to have a waypoint in between, so that the missile first moves via Lerp or MoveTowards until it reaches the waypoint, then via Slerp to the foe. However, the result is that once the missile reaches the waypoint, it turns sharply and moves in a slight arc from then on. It looks like it bounced off an invisible wall.
I've looked for some kind of simple-to-use easing function to bridge that waypoint, but I'm not finding much. I'm hoping there's a simpler way to do this then spelling out a bunch of math for how to handle the waypoint transition.
Currently, my Slerp command looks like this:
transform.position = Vector3.Slerp(transform.position,target.transform.position,mySpeed/distance * .025);
Any ideas on how to make something like this work?
Thanks in advance!