Random Map Generation

Hello!

I am trying to create a map that will generate as the player walks into new chunks

The game is already designed to where the player can only see one chunk at a time!!!
I have these parts at the end of each section of the map and they are named:

These parts align to the other part as they should
PartA - PartC
PartB - PartD
PartC - PartA
PartD - PartB

The goal is to make it so the whole model will move when a PartA aligns with

Chunk Image:

The Question!

How do I make a generating map as the player walks?

I would prefer it to generate as a 9x9 when the game starts and as the player walks it will create new chunks.

I also don’t want this to happen:

HELP!

Whenever the player moves you can calculate what chunk they are in by dividing by the chunk dimensions. You can calculate which chunks are around them by adding and subtracting 1 from each dimension, then make sure those neighbor chunks are loaded. If you also want to unload chunks, you can set a max number of chunks and unload the furthest away one when you reach that limit.

A good way without parts is using attachments and attaching them with rigid constrains. Hope it helped!

Thank you both for the help.

I will try my best to come up with the code on my own but if I cant I’m going to be right back to the start lol

I would say for rendering the chunk, every second or so send a remote function to the server requesting a chunk from the given character position and then have the server send back a model and cframe for the client to render.