This item is the core component to allow an item to break in Blade and Sorcery. This component supports GameObjects that contain the Item Script, as well as supporting components that only contain rigidbody.

Usage

Basic Setup

  1. Create an Empty GameObject, add the Item script.
  2. Crate another empty GameObject under the item, recommended to name "Unbroken. Move the parent "HolderPoint, "ParryPoint" and "Preview" under this object.
  3. Set up the "Unbroken" GameObject in to an Item, with all damagers and colliders, as well as the unbroken mesh. (See Item on how to set up items)
  4. Now, set up a new GameObject under the main Parent, recommended to name "Broken".
  5. Put all broken meshes under this gameobject. If you want to make them in to an item, put the mesh under a parent, and set the broken parts as Item . All non-item broken meshes MUST contain a RigidBody.
  6. Once completed, add the "Breakables" script at the top parent, where the main Item is.
  7. Set the "Unbroken" Gameobject in the "Unbroken Objects Holder" and the "Broken" Gameobject in the "Broken Objects Holder".
  8. The Breakables Item is now setup, now you can adjust the fields to your liking.

<aside> 🗒️ The broken items can use the same Item ID as the broken mesh, however they can also contain different item IDs, even their own, to ensure that they have the same weight and item properties.

</aside>

BreakableOrganisation.PNG

Buttons

This script has five buttons which assist you in setting up the breakable items automatically.

Button Description
Set up handles Automatically sets up handles between the unbroken and broken items. For the handles to link, they must be in the same rotation and position.
Check for collider intersection Four buttons check for this, in which it will check the item intersections between the broken items, to prevent unwanted explosion. You can check between a 10cm threshold, 5cm threshold, 1cm threshold and 0cm threshold.

Gizmo

This component contains a lot of Gizmo to help you check visually if the item is set up correctly.

Gizmo.png

Component Properties