#Help turn 1D Prefab Generator into 2D One
1 messages · Page 1 of 1 (latest)
https://www.toptal.com/developers/hastebin/uxexibehuz.csharp
this is the current script,
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
i was also testing a little "safe zone" where it removes the chunks that the player is not near
if i could get any help on how i could go doing this i would really appreciate it.
I'm not quite sure on what the code does. Basically it instantiate a new chunk only in the z axis?
I was thinking these days how Minecraft handles the management of chunks and render what is in the world. I was convinced that keeping track of the player's current position is not good. So, as I love callbacks, I thought that having movement called be player on changing it's current chunk position would be a great way to handle that situation
I mean, these way the chunk controller would subscribe to player's chunk change callback and handle what needs to be changed at all
U do not need to check the player's current position each frame anymore
About the x, -x chunk spawn a simple for could solve your problem. Assuming that u know how long the x and z gonna be, make a for (int I = 0; I <= rows; I++) the same for z ans column