Destructor package

Destructor

Welcome to the Destructor package guide.


What is Destructor?

Destructor is a tool that provides enhanced wall damage in Crayta. It combines the Crayta build-in HitResult, particle systems and voxelgrid. But why read about what visual effect it produces if you can see a demonstration right here:

[Destructor package on Youtube]

What’s included in the package?

In the package you will find:

  • 4 x “Destructor” templates
  • 2 x “Example Destructor Wall”
  • 4 x “___Destructor Debris” templates
  • A set of voxel meshes for each of these templates
  • DestructorScript
  • EffectManagerScript
  • PhysXScript
  • Documentation

How to use

After downloading the package, Destructor comes ready-made. This means you should be able to use the “Destructor” template right away. In this guide I explain this set-up, more details and other custom set-ups are explained in the Destructor documentation (also included in the package). For now, to use Destructor follow these steps:

  1. Pick a “Destructor” template, presets for Red Brick, Grey Brick, Wood and a custom style are included to choose from. Add the template to your hotbar.

  1. Add the template to your voxel mesh by clicking on it with the template selected.

  1. Open the Entities World-tree and click on the “DestructorSettings” script folder. Here you see the configuration of Destructor on your voxel mesh.

  2. Here you see the DestructorScript with it’s properties. As you can see there is no entity selected for the field Damage Entity yet. For Destructor to work, you have to set this part up.

  1. Drag your voxel mesh (orange colored in the screenshot above) into the Damage Entity field. Now Destructor knows which wall to work with.

Also, the Radius property lets you adjust the size of the crater that you leave behind. Default is 75, meaning 75 cm diameter hole in your voxel surface. Destructor varies the crater size between this number and randomly + 25 cm more for variety in craters.

  1. Now select your voxel mesh and check the box for “Damage Enabled”. An “On Damage” event becomes available. Drag the DestructorSettings script folder onto the +.

  1. Where it says ‘Unset Binding’ simply select the “OnDamage()” Event of the DestructorScript. Once you have done this, the set-up is complete.

Now get to Destructor’ing!

Start the game preview and use any method to inflict damage on the voxelmesh to create the high impact destruction effects. Have fun!

That was all. If you encounter any questions or have other comments or questions, feel free to post in this topic, I’ll do my best to help out. But also if you have technical suggestions, improvements, share them here to make Destructor better :smiley:

#Currently in development
- Entity pooling
- More variation in effects
- Mesh debris 
- Auto mesh fracturing
# Honorable mentions and packages used:
- Entity Reset package (which I used to make the PhysXScript)
- Simple Sign package (used for package instructions)
- the Feedback Friday gang for their feedback and testing
- Crayta tutorials
2 Likes

Package has been updated and handles collisions with players better and now has optional removal of the spawned debris,

* 2 methods of getting rid of debris added
* Made disappearing debris optional
* Fixed spawn issue that prevented debris from disappearing
* Updated forum to reflect applied changes.

Hey man, loving this package. Do you have a guide for how to set up the custom voxels templates? I have different types of voxels in my game I want to destroy.

Also is there a way to have smaller chunks of voxel debris?

Hey @ChunkyLoverMark

I’m pleased you like the package. Isn’t destruction awesome? :crazy_face:

Do you have a guide for how to set up the custom voxels templates?

Not yet, currently. Basically the Destructor uses a group of voxelmeshes. For smaller (or larger) debris, you can go to the Voxelmesh tab, locate the different debris voxelmeshes and change them however you like (using the voxel-tools).

Any changes you make to these voxelmeshes are automatically updated by the Destructor. Then you can just go into preview to check/see if you like the shapes you made.

Also is there a way to have smaller chunks of voxel debris?

Yeah, I’ve been experimenting with this myself and I kinda like the smaller debris. I think I will make this the default type of debris in the next update :raised_hands:

Also, if you want we can hop in your game together and take a look :sunglasses:

1 Like

Hi, I’ve noticed the package doesn’t play nicely with other packages that create damage via the ApplyDamage() method. As you can see in the screenshot below it’s giving loads of errors:

Anything that applies the damage with a raycast like a rocket launcher works fine. Do you have any suggestions for how we can fix this?