Interpolating along an arc.

I am trying to move an object between two points along an arc with respect to another point. I have a starting point A, an end point B and third point C. I want to make my object move from A to B along an curved path where the convex side of the path is facing away from point C.

I tried using Vector3.Slerp as shown in the documentation and I can get the curved path, but sometimes the path is flipped and the object goes through C.

My code is very similar to this example. How can I get the path to always be go away from C?

You should use a Bezier curve if you have a third influential point. It includes a curve script which plots the points of the curve, however with a bit of alteration it can be used similar to lerping (without using the Vector3.Lerp function). Just substitue ‘t’ for your timer.

Vector3 bezierPosition = (((1 - timer) * (1 - timer)) * m_StartPosition) + (((1 - timer) * 2.0f) * timer * m_CurvePosition) + ((timer * timer) * m_TargetPosition);