Using Object.Instantiate generating terrain for a 3D infinite jumper

I am brand new to Javascript/unityscript. I was trying to figure out the best way to randomly keep terrain generating for my 3d infinite jumper that I am working on. so anyways what I was wondering would it make sense to make a script that basically checked the players y axis and as he got really close it would use the Object.Instantiate to generate the terrain that he already jumped on to move it above the player so that he could infinitely jump. Will this work?

Ps. I do understand by doing this it would not randomly generate the terrain I plan on working on that later after i figure this out.

You should check out this official tutorial from Unity Technologies: https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/infinite-runner

Instead of making it horizontal, you could make it vertical as a challenge to yourself, but have a solid foundation on how you should approach each problem.

Thank you for the quick reply! I will take a look at that link! Thank you for the anwser