# Create Bezier curves with random heights that connect

In unity, I am trying to create several curved platforms that connect using bezier curves, however I am having issues. I understand the basics of genertating a bezier curve and I have something working well

My goal is to generate a series of forward moving Bezier curves, that are all connected to each other, while also having varying lengths and points. I have something working, however I am having issues connecting the curves, while retaining random Y values for different heights in the 4 points.

Below is my attempt:

Below is a Sketch I did in MS Paint to help explain goal:

From the sketch you can see that there is a diffrence in height between gameobject 0 and 1 but they are still connected. How can I generate the next points with random Y values, while still accounting for the previous curve? Any help would be greatly appreciated,

• I had a similar setup in a game. What i did was like gameobject1.P0 = gameobject0.P4 and also tangent at gameobject0.p4 = tangent at gameobject1.p0. Tangent of the curve is basically the derivative at that point. I don't have the files with me now but you can give it a shot like this Feb 8, 2017 at 5:47
• Why can't you start the generation of the next chunk at the last point of the previous chunk? Feb 8, 2017 at 11:18
• Thank you Nightcrawler23 and jgallant for the help! I was able to figure out the issue but I wanted to say thank you for your time! Feb 12, 2017 at 15:37

p2 = p1 + t1 - t2