Blood Engine - A droplet emitter system

why isnt my script working? it doesnt give an error it just doesnt emit the blood

-- Import the BloodEngine module
local BloodEngine = require(game.ReplicatedStorage.Asset.Modules.WaitForChild("BloodEngine"))

local Humanoid = script.Parent:WaitForChild("Humanoid")
local OldHealth = Humanoid.Health
local LocalPlayer = game:GetService("Players").LocalPlayer
local torso = script.Parent:WaitForChild("Torso")


-- Initialize BloodEngine with desired settings
local Engine = BloodEngine.new({
	FolderName = "Droplets", -- Specifies the name of the folder containing the droplets.
	Type = "Decal", -- Defines the droplet type. It can be either "Default" (Sphere) or "Decal".
	Limit = 500, -- Sets the maximum number of droplets that can be created.
	Filter = {}, -- An array/table of instances that should be ignored during droplet collision.

	DefaultSize = { 0.4, 0.7 }, -- Specifies the default size range of a pool.
	DefaultTransparency = { 0.3, 0.4 }, -- Specifies the default transparency range of a pool.
	StartingSize = Vector3.new(0.1, 0.3, 0.1), -- Sets the initial size of the droplets upon landing.
	ScaleDown = true, -- Determines whether the pool should scale down when decaying.

	DropletDelay = { 0.01, 0.03 }, -- Sets the delay between emitting droplets in a loop (for the EmitAmount method).
	DropletVelocity = { 1, 2 }, -- Controls the velocity of the emitted droplet.
	DropletVisible = true, -- Determines if the droplet is visible upon emission.
	DropletColor = Color3.fromRGB(103, 0, 0), -- Determines the color of the emitted droplet.

	RandomOffset = true, -- Determines whether a droplet should spawn at a random offset from a given position.
	OffsetRange = { -5, 5 }, -- Specifies the offset range for the position vectors.

	SplashName = "Impact", -- The name of the attachment that releases particles on surface contact.
	SplashAmount = { 5, 10 }, -- Sets the number of particles to emit upon impact.
	SplashByVelocity = true, -- If true, sets the number of particles based on the velocity of the droplet.
	VelocityDivider = 8, -- Controls how much the velocity can affect the splash amount, Higher values reduce the effect.

	Expansion = true, -- Determines whether a pool can expand when a droplet lands on it.
	Distance = 0.2, -- Sets the distance (in studs) within which the droplet should check for nearby pools
	ExpanseDivider = 3, -- Controls how much a pool's size can increase. Higher values reduce the increase.
	MaximumSize = 0.7, -- Sets the maximum size a pool can reach.

	Trail = true, -- Controls the visibility of the trail during droplet emission.
	DecayDelay = { 10, 15 }, -- Sets the delay before the droplet decays and recycles
})



Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
	if Humanoid.Health < OldHealth then
		local count = 0
		repeat task.wait(.1)
			count += 1
			local difference = math.abs(Humanoid.Health < OldHealth)
			print(difference)
			Engine:Emit(torso, torso.CFrame.Y * Vector3.new(math.random(-120,120),math.random(15,25),math.random(-120,120)), 120)
		until count >= (0.5 * difference)
		count = 0
	end


	OldHealth = Humanoid.Health
end)
1 Like

Put it in StarterPlayerScripts and make it act as a management for all blood related stuff.

hello, I had to disturb you again - as I see, the YSize parameter does not work at all, even in the newest version :((((

my code:

local Splats = blood.new({
	FolderName = "Droplets", -- Specifies the name of the folder containing the droplets.
	Type = "Default", -- Defines the droplet type. It can be either "Default" (Sphere) or "Decal".
	Limit = 500, -- Sets the maximum number of droplets that can be created.
	Filter = {game.Workspace.Characters}, -- An array/table of instances that should be ignored during droplet collision.

	YSize = {0.0001, 0.0001}, -- Specifices the range of the thickness/flatness/depth of the pool. Lesser is flatter.
	DefaultSize = { 0.8, 2 }, -- Specifies the default size range of a pool.
	DefaultTransparency = { 0.2, 0.4 }, -- Specifies the default transparency range of a pool.
	StartingSize = Vector3.new(0.0001, 0.0001, 0.0001), -- Sets the initial size of the droplets upon landing.
	ScaleDown = true, -- Determines whether the pool should scale down when decaying.

	DropletDelay = { 0.01, 1 }, -- Sets the delay between emitting droplets in a loop (for the EmitAmount method).
	DropletVelocity = { 1, 8 }, -- Controls the velocity of the emitted droplet.
	DropletVisible = false, -- Determines if the droplet is visible upon emission.
	DropletColor = Color3.fromRGB(67, 0, 0), -- Determines the color of the emitted droplet.

	RandomOffset = false, -- Determines whether a droplet should spawn at a random offset from a given position.
	OffsetRange = {-20, 10}, -- Specifies the offset range for the position vectors.

	SplashName = "Impact", -- The name of the attachment that releases particles on surface contact.
	SplashAmount = { 5, 10 }, -- Sets the number of particles to emit upon impact.
	SplashByVelocity = true, -- If true, sets the number of particles based on the velocity of the droplet.
	VelocityDivider = 8, -- Controls how much the velocity can affect the splash amount, Higher values reduce the effect.

	Expansion = true, -- Determines whether a pool can expand when a droplet lands on it.
	Distance = 0.2, -- Sets the distance (in studs) within which the droplet should check for nearby pools
	ExpanseDivider = 3, -- Controls how much a pool's size can increase. Higher values reduce the increase.
	MaximumSize = 1, -- Sets the maximum size a pool can reach.

	Trail = true, -- Controls the visibility of the trail during droplet emission.
	DecayDelay = { 10, 15 }, -- Sets the delay before the droplet decays and recycles

})

Try disabling Expansion and check what happens.

I’m going to remake this entire engine, it has major bugs and awful optimization (my game suffers from it). I really want to make this have less hacky things and I think I’m going to make it rely on Roblox physics again.

Great module! But i’m having an issue. Everytime an npc/player is shot in my game, like 50 droplets spawn. But when multiple shots are being fired, it lags TERRIBLY and freeezes the game for like a minute.

1 Like

its really good, just quite buggy ive noticed, players blood doesnt despawn but npcs doesnt which is odd.

1 Like

Same goes for me on my game, still working on it, i’d say an estimate for release is next week or after that. It’ll still be really barebones though and probably in Alpha; I’m currently designing the framework itself for performance.

Great system but does anyone know why don’t the decals work? Do i need to use my own textures?

1 Like