Hi all,
I’m currently placing objects on the surface of a sphere, and can already calculate the point between the two object positions (using the code below). I have a Line Renderer drawing a line from point A to C, with the calculated point being B, however, how can I calculate the surface normal position of point B so my line will arc across the sphere?
public static void CreateLink(GameObject linkModeTarget)
{
Vector3 pos = Vector3.Lerp(linkModeParent.transform.GetChild(0).position, linkModeTarget.transform.GetChild(0).position, 0.5f);
LineRenderer linkModePrefabOptions = linkModePrefab.transform.GetChild(0).GetComponent<LineRenderer>();
linkModePrefabOptions.SetPosition(0, linkModeParent.transform.GetChild(0).position);
linkModePrefabOptions.SetPosition(1, pos);
linkModePrefabOptions.SetPosition(2, linkModeTarget.transform.GetChild(0).position);
}
This is the current result:
And this is what I’m after:
Thanks for having a look.