How do I draw a Bézier curve to have 90 degree angles ?

Hi guys , I am trying yo understand how to draw bezier curves that have 90 degree angles like this 64685-90db.png

Here is a method i use to draw a curve between two points. The typical script you usually see for drawing bezier curves in unity.

However this give me a very curvy bezier , I am trying to get the bezier to have 90* angles where they would usually curve

        public static void DrawConnector(Vector2 statPoint, Vector2 endPoint)
        {
Event e = new Event();
            Vector3 startPos = new Vector3(statPoint.x, statPoint.y);
            Vector3 endPos = new Vector3(endPoint.x, endPoint.y);
            Vector3 startTan = startPos + Vector3.right * 50;
            Vector3 endTan = endPos + Vector3.left * 50;
            Color bizcol = (endPoint != e.mousePosition) ? Color.red: Color.blue);


            for (int i = 0; i < 1; i++) 
            Handles.DrawBezier(startPos, endPos, startTan, endTan, bizcol, null, 2);

        }

A tool like this will help visualise what you’re doing: cubic-bezier.com

What you probably want is something more like this: cubic-bezier.com

Note that in your code your first tangent is Vector3.right, and the second is Vector3.left (illustrated in the first link), where as you’ll probably want one tangent as Vector3.right, and the other as Vector3.down (or Vector3.up * -1 as I’d write it)

Why? Well consider what a tangent is. At your control points (the start and end positions), in natural language a tangent is a line which will just touch the control point and be completely parallel to the curve at that point.