Asset Mage W

Testing and Tweaking

To test the Destructor, enter Play Mode and open the prefab with the script, which is a child of your object. There you'll find a button to test the Execute function. You can set the Cleanup Delay to -1 so the Game Objects aren’t removed and you can test it multiple times.

VFX offers a wide range of properties that can help you adapt the destruction to a specific object and conceal its removal.
Most important VFX properties:
- VelocityCenter – origin point of particle force. You can use this to match the direction of the incoming attack, creating more realistic and directional destruction effects. It’s Vector3 position that can be set via Component API. Keep in mind that this is in a local space relative to the VFX prefab's position.
- VelocityMultiplier – allows you to easily adjust the particles' force
- MeshOffset – depending on the shape of the spawn box, it may be helpful to increase this value or enlarge the spawn box to better conceal the disappearance of the object
- scale and spawn count of various components to fit your object