Bloody Mess 2D

BM2D

Designed for Unity, BM2D is a powerful game developing asset that lets you easily add great looking, & professional player feedback effects to your project!

Bloody Mess 2D – blood, gore, & more!

Download Link

____________________________________________________

Bloody Mess 2D – Documentation

THE BASICS

When working inside of BM2D you will be using three main scripts/prefabs, BM_Manager, BM_Effects & BM_SurfaceSplatter.

BM_Manager handles all instances of BMFX via global settings.

BM_Effects (BMFX) controls & applies effects to selected GameObjects.

BM_SurfaceSplatter is where you set up the properties of a Surface Splatter.

What is Surface Splatter?

In BM2D, surface splatter is the term used to describe sprites that are only visible on selected surfaces.

How to select a GameObject as a surface? 

First change the sprite renderers material:

  1. Select any GameObjects you wish to use as a surface
  2. Inside the “Sprite Renderer” component of your surfaces.
  3. Change the material from “Sprites Default” to “Surface Material”

Then check that the particles from the BMFX prefab are set to collide with them:

  1. Select the BMFX prefab you itend to use.
  2. Open the attached “Particle System” component
  3. Inside the “Collision” tab of the “Particle System”, check what layer/s your particle are set to collide with. (Adjust if necessary)
  4. Ensure any GameObject you want to be a surface is are on one of these layers.

How do I use BM2D in my project?

Once imported into you project, you can begin to use BM2D with very little set up.

  • First add a BM_Manager prefab to your scene by either dragging & dropping the prefab into the hierarchy or the scene itself.
  • Then select a BMFX prefab and begin applying effects the Game Objects of your choice.
  • Once you have finished customizing your BMFX prefab simply place that in the scene at the desired time to activate the effects.

Note: See BM_Effects section of documentation for more detailed information on using BMFX  in your project.

BM_MANAGER

As its name suggest the BM_Manager prefab manages all instances of the BMFX prefabs by providing global control over their effects.

To use the BM_Manager prefab, simply place it in any scene where you will be using BMFX & customise the settings via the inspector.

The BM_Manager also contains 3 object pools which are used by the Surface Splatter effect inside the BMFX prefabs. (See BM_Effects for more information)

BM_Manager

What is an Object Pool & why is it important?

An object pool instantiates many disabled copies of selected object when the scene starts. This collection of objects is known as the pool. When needed the objects are grabbed from the pool & enabled to be used as desired. After they are no longer needed they are disabled & returned to the pool. This removes the need to constantly create & destroy frequently used objects, instead reusing previously created ones.

In BM2D the pooled objects are used as surface splatter & enabled when particles from a BMFX prefab collide with selected surfaces. Because the effect is recycling unused splatter rather then creating & destroying new ones all the time, it reduces the overall CPU demand.

How do I set up an object pool for use with the BMFX prefabs?

  • Inside the BM_Manager
  • Select a GameObject OR BM_SurfaceSplatter to pool
  • Then set the IPA (Initial Pool Amount).
  • Select “Pool Will Grow” to allow the pool to exceed the IPA at run-time. If left unchecked splatter will be capped at IPA value.

BM_EFFECTS

BMFX is where you will spending most of your time when working with BloodyMess2D.

To navigate BMFX simply click the icons and/or tabs located at the top of the script in the inspector.  To see the general settings click the BMFX2D icon. Use these icons & tabs to select & set up the effects you want to use. See below documentation  for more in depth information on the individual effects.

BM_Effects starts working as soon as it is enabled in a scene.  However to take full advantage of the BM2D asset, you will want enable it at specific times throughout your project. There are a number of ways to do this, listed below the image are a just few examples.

BMFX_SettingsGen2

DRAG & DROP

The simplest of all methods, Drag & Drop is great for testing BM_effects prefabs. It will start the prefab as soon as the scene it is in starts.

  1. Place the BM_Effects prefab into a scene
  2. Check that it is enabled
  3. Run the scene

ENABLE VIA CODE

This method involves disabling the BMFX prefab you intend to use, placing it in a scene & enabling it again progmatically at a desired time.

  1. Disable the BMFX prefab
  2. Attach BMFX prefab to a GameObject. (Optional) eg. Player
  3. Copy one the provided sample codes below
  4. Paste it into a new or existing script
  5. In the inspector, select your BMFX using newly created input field
Example 1:

// add ' using System.Collections.Generic; ' to the very top of your script if it doesn't already exist
// Use ' StartCoroutine (RunBMFXPrefab()); ' at desired time in your script to run this function.
 
[SerializeField] private GameObject myBMFXPrefab;
[SerializeField] private float WaitXSecondsBeforeDisabling = 10.0f;
 
IEnumerator RunBMFXPrefab()
{
    myBMFXPrefab.SetActive (true);
    yield return WaitForSecondsRealtime (WaitXSecondsBeforeDisabling);
    myBMFXPrefab.SetActive (false);
}

Example 2:

[SerializeField] private GameObject myBMFXPrefab;
 
// Use EnableBMFX(); inside another void to call this function
private void EnableBMFX()
{
     myBMFXPrefab.SetActive (true);
}
 
// Use DisableBMFX(); inside another void to call this function
private void DisableBMFX()
{
     myBMFXPrefab.SetActive (false);
}

ENABLE VIA ANIMATION

Like the ‘Enable Via Code’ approach, this method also involves disabling the BM_Effects (BMFX) prefab you intend to use before placing it in a scene. However this time it is re-enabled via an animation (eg. Players death animation) rather then using code.

  1. Disable the BMFX prefab
  2. Attach BMFX prefab to the GameObject whos animation you will be using (eg. Player)
  3. Inside an animation (eg. Players death animation)
  4. Chose a point in the animations timeline to enable BMFX prefab.
  5. Once selected, enable the BMFX prefab
  6. Exit the animation window & ensure BMFX prefab is disable again.

NOTE: Ensure ‘Destroy after X seconds’ is disabled in the BMFX prefab you are using. It’s also a good idea to disable the prefab again either inside the same animation or during say the idle animation.

INSTANTIATE USING INSPECTOR

When you instantiate something you are spawning a copy of the original object. This method lets you instantiate a BMFX prefab by selecting it in the inspector.

  1. Copy the provided sample code below
  2. Paste it into a new or existing script
  3. Select a BMFX prefab to instantiate using the newly created input field in the inspector.
[SerializeField] private GameObject myBMFXPrefab;
 
// Use InstBMFX(); inside another void to call this function
private void InstBMFX()
{
 Instantiate (myBMFXPrefab);
}

INSTANTIATE FROM RESOURCES FOLDER

When you instantiate something you are spawning a copy of the original object. This method lets you instantiate a BMFX prefab straight from a ‘Resources’ folder inside your Assets.

SET UP:

  1. Create a new folder anywhere inside your project.
  2. Name it ‘Resources’ (case sensitive)
  3. Place desired BMFX prefab inside ‘Resources’ folder
  4. Take note of its name (eg. ‘myBMFXPrefab’)

HOW TO:

  1. Copy the provided sample code below
  2. Paste it into a new or existing script
  3. Still inside that script, change the text \”myBMFXPrefab\” to the name of the BMFX prefab in the Resources folder
// Use InstBMFX(); inside another void to call this function
private void InstBMFX()
{
 Instantiate (Resources.Load ("myBMFXPrefab"));
}

BM_SURFACE SPLATTER

BM_SurfaceSplatter is a simple script/prefab where you set up the properties of a Surface Splatter. This splatter can then be added to a BM_Manager object pool OR directly to a BMFX prefab to use with the Surface Splatter effect.

Note: Please refer back to the “BM_Manager” section of documentation for information on adding Surface Splatter to the object pool.

What is Surface Splatter?

In BM2D, surface splatter is the term used to describe sprites that are only visible on selected surfaces.

BM_SurfSplat

Remove splatter after X seconds : When enabled the splatter will remove itself from the scene after the value given in lifetime field.

Lifetime : How many seconds it takes for splatter to remove itself from the scene.

Fade Splatter : When enabled the splatter will fade out before being removed.

Random Colour : Sets the sprite renderer of splatter to a random colour when enabled.

Random Rotation : Splatter is rotated in random direction when enabled.

Random Size : Randomly adjust the scale of the splatter when enabled within the min & max splatter size.

Min/Max Splatter Size : The random size will be clamped between these value.

Advanced Settings: Show/Enable advanced settings

Max Neg & Pos Offset On Complex Surfaces : These values represent a maximum offset from the parented object allowed before the splatter is removed. Removes any outlying splatters.