How to do Multiplayer Chunk Spawning?

Hello, Im currently making a chunk spawning system similar to minecraft. I have the base system ready, but I cant figure out how to spawn the chunks on the server for the client. I need to do this because otherwise, if the client tries to walk to chunks that the server hasnt generated, the client will just fall through the floor because the server doesnt actually know of a chunk in that area. Now, my generation system is pretty lightweight so it should be fine to make the server load his chunks and the clients chunks, however I cant seem to get the chunks to spawn on the server for the client.
I made a simplified version of my system to showcase the problem:


what i do here is just when the player starts playing or enters new chunks, it gets the player location, multiplies the chunk scale, feed these variables into the struct current, setting all chunk visible coordinates with for loops, checking if chunks have already been generated, and finally generating the chunk (this code is in the player blueprint)

The Server needs to execute UpdateChunks, not the client.

At the Contains Branch False you want the Server to call a Multicast that calls Spawn Chunks.

You’ll need to pass all relevant data that spawn chunks needs into the Multicast event.


Other option (hefty) is to make the BP Test Chunk actor Replicated. Then All the above code (pics) would just run on the server.