How could I create an endless stairs effect?

I am looking to create an endless stairs effect similar to that in Super Mario 64. So the player would go up the stairs, and no matter how far they go, if they turn around they will be at the bottom again. Endless Stairs 10 Hours - Super Mario 64 - YouTube This video will show you what I’m on about, but it’s a 10 hour long video… But yeah could someone please tell me how I could create this effect?

Maybe use an invisible wall, and make the stairs move down in the y and z axis, and maybe when it reaches a certain point it goes back up, it would need to be really smooth tho to make it look good

Create a prefab for a section of stairs, and a trigger that will be placed a little bit up the stairs. Have the bottom of the stairs in a separate GameObject.

When the player hits the trigger, have it spawn a copy of the stairs prefab just a little beyond the stairs that are currently available, and move the trigger forward the same distance as the stairs length.

At the same time, delete the section of the stairs at the bottom, and move the position of the stairs bottom to that position.

Alternatively you could just have two long sections of stairs and have the bottom one move past the top one, rather than constantly spawn new ones. You could even make two triggers as part of the stair prefabs rather than stand-alone. I suggest against that if the player has the ability to look down the stairs while walking up them backwards.

If they do have the ability to walk up the stairs backwards and view the bottom, I’d make some tweaks to the trigger. Have it create the new section of stairs above the existing all the time, but only delete the lowest section and move the bottom when they’re facing forward. This way, they’ll think they’re making progress as they’re walking away from the bottom, but it’ll still be infinite and the bottom of the stairs will catch up to them the moment they turn around.