I know this is a late reply, but the module is pretty cool. I’ve made my own blood module from scratch that uses fast cast for, but I find this one more efficient. Thanks a lot!
For the transparency, I’m pretty sure you’re talking about DefaultTransparency, which can be used like this:
local Engine = BloodEngine.new({
DefaultTransparency = { 0.3, 0.4 }, -- Specifies the default transparency range of a pool.
Limit = 100, -- Sets the maximum number of droplets that can be created.
Type = "Default", -- Defines the droplet type. It can be either "Default" (Sphere) or "Decal",
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.
DropletVelocity = {1, 2}, -- Controls the velocity of the emitted droplet.
DropletDelay = {0.05, 0.1}, -- Sets the delay between emitting droplets in a loop (for the EmitAmount method).
StartingSize = Vector3.new(0.01, 0.7, 0.01), -- Sets the initial size of the droplets upon landing.
Expansion = true, -- Determines whether a pool can expand when a droplet lands on it.
MaximumSize = 1, -- Sets the maximum size a pool can reach.
})
As for changing the droplet color, you’d have to do it manually by changing the color of the type that you’re using:
Thank you. It is quite annoying that the particle colors are not in the settings, so i’ll just make multiple clones of the module for each of the liquids i’ll be using, but thanks for clarifying about the drop transparency
This system appears to have a bug with the decal and sphere blood types where it’ll randomly cause objects stop rendering. My only closest clue on where it comes from is that the decals are all attaching themselves to the baseplate, but honestly, I don’t know much about why it happens.
This isn’t objects being deleted or set to transparent, either. You can even see the large brick’s shadow even though it cannot be seen.
• Improvements to Emission: You can now emit mixed droplets (decal & default) without making a new emitter instance!
• Droplet Color: There’s a new DropletColor setting to change the color of your droplets/pools.
↳ Other Notes
While this was a minor update, what you can do with it is anything but.
Here’s a showcase to show what you can do with this new release:
You can now do a mix of Droplets and Decals. And without creating multiple emitter instances that might eat out your performance.
Here’s the code behind it:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BloodEngine = require(ReplicatedStorage.BloodEngine)
local Engine = BloodEngine.new({
Limit = 500,
})
local EMIT_AMOUNT = 50
local EMIT_DELAY = 5
local function Emit()
-- A random chance of the droplet being a decal
local IsDecal = math.random(0, 1) == 1
-- Emits a droplet in a random direction relative to a part, and there's a chance that it could be a decal.
Engine:Emit(script.Parent, nil, {
Type = IsDecal and "Decal" or "Default",
DefaultSize = IsDecal and { 1, 1.4 } or { 0.4, 0.7 }
})
end
-- A custom iteration of the EmitAmount method
while true do
for Index = 1, EMIT_AMOUNT, 1 do
local DropletDelay = math.random(0.05, 0.1)
Emit()
task.wait(DropletDelay)
end
task.wait(EMIT_DELAY)
end
I second this, some sort of Data parameter in Settings > UpdateSettings is causing errors
The error originates from here:
function Settings:UpdateSettings(Data: {})
-- Variable definitions
local Filter = self.Filter
local Params = self.RaycastParams
for Setting, Value in Data do
self[Setting] = Value
end
-- Update Param properties
Params.FilterDescendantsInstances = Filter
end
Update, I have taken it upon myself to fix the problem and have succeeded with a bit of work, here are the steps to fix the nil Data problem:
Inside of the UpdateSettings function in the Settings module, replace Settings:UpdateSettings with:
function Settings:UpdateSettings(Data: {})
-- Variable definitions
local Filter = self.Filter
local Params = self.RaycastParams
if Data then
for Setting, Value in Data do
self[Setting] = Value
end
end
-- Update Param properties
Params.FilterDescendantsInstances = Filter
end
Inside of the Operator module, replace the local Clone = table.clone(self.Handler) section with:
local Clone = table.clone(self.Handler)
Clone:UpdateSettings(Data or {})
Data = Clone
Inside of the Settings module, replace the Settings.new section with:
local self = setmetatable({
-- Replace with whatever you have here in the original Settings.new module
}, Settings)
-- Make sure the Data table actually is a table and not nil
Data = Data or {}
for Setting, Value in Data do
if Setting == "Tweens" then
for Tween, Info in Value do
self.Tweens[Tween] = Info
end
continue
end
self[Setting] = Value
end
return self, self:CreateParams()
Does this need to be destroyed if a new engine is created everytime the client respawns, or will it garbage collect itself? I don’t see a destroy method anywhere for this.