Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

No documentation (HOW DO I USE THIS) #4

Open
lucasabbas opened this issue Mar 13, 2022 · 2 comments
Open

No documentation (HOW DO I USE THIS) #4

lucasabbas opened this issue Mar 13, 2022 · 2 comments

Comments

@lucasabbas
Copy link

How am I supposed to use this without any documentation? I need a voxel engine for my game

@lucasabbas
Copy link
Author

I'm look for a voxel engine to replace my gameobject-based block building system

@Hertzole
Copy link
Owner

Hi!
Yeah, the documentation is really lacking for this project. I'll do my best to help you get started, but please keep in mind that development on this project has ceased and I probably won't update it any further!

Here is the whole project with the example included. I'll be basing most of my help on this.

To generate a world, you'll need a game object with the VoxelWorld script attached. Then on the same object, you'll need a script that generates a world. There's a HertzVoxExampleWorld script in the example that generates a flat world.
To make your own world generator, you'll need a script that implements the IVoxGeneration interface. Then you'll need to implement the BuildChunk method that must return a Unity job.

Your player/camera should have the VoxelLoader script attached to make chunks load around the player. You can place other VoxelLoader scripts in your scene to keep chunks loaded around that object.

Then, lastly, to place down voxels, you first need to get your block with Block myBlock = BlockProvider.GetBlock("block_name"); and then you can use that block to set a voxel with Voxels.SetBlock(new int3(12, 12, 12), myBlock);.

I hope this helps you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants