UIParticle - A UI Particle Emitter

weird, it should work with any ui element…

After some searching through the source code i saw that there was no support for the Squash property of particles. It’s a pretty important property and i’d like to see it being added to the module. Thanks in advance

1 Like

I failed to load the module somehow,
It’s said that “ReplicatedStorage.ParticleModule:214: Expected ‘->’ when parsing function type, got ‘|’”. I am confused because I just copy the whole thing nothing should be broken. this is method chaning one and changing to the normal one doesn’t fix anything.

Hi
Probably a change to the luau typechecking rules that caused this…
Changing line 214 to this:

EmitterMode: ("Point") | ("Fill"),

fxes the issue.

5 Likes

is there any documentation available? I can’t seem to find it in github

This looks really cool, always wondered how developers did the ui particles. I usually thought they were just cloning a ton of icons and then doing some math and tweening.

Having the same issue, I found that the size only works if you use Offset instead of scale.

2 Likes

hey, the element in the case is the Id of the decal right?

wondering because its not working for me at all

can you post an example file with all the things you can customize? I keep running into errors and have no idea how to use this

Just come across this today - the function used to evaluate NumberRanges seems to not work with non-integers.

If you replace the evalNR function with this, it should work:

function evalNR(range)
	
	if typeof(range) ~= "NumberRange" then return range end
	
	if math.round(range.Min) == range.Min and math.round(range.Max) == range.Max then
		return math.random(range.Min, range.Max);
	end
	
	return range.Min + math.random() * range.Max
	
end
1 Like

I’m actually having a problem with the module. Whenever I remove the entire frame with all the particles and image labels inside it doesn’t stop printing this error in the output.

  20:51:55.841  The Parent property of ImageLabel is locked, current parent: NULL, new parent TitleFrame  -  Cliente - UI_EmitterModule:123
  20:51:55.841  Stack Begin  -  Studio
  20:51:55.841  Script 'ReplicatedStorage.Utils.UI_EmitterModule', Line 123 - function addParticle  -  Studio - UI_EmitterModule:123
  20:51:55.841  Script 'ReplicatedStorage.Utils.UI_EmitterModule', Line 23  -  Studio - UI_EmitterModule:23
  20:51:55.841  Stack End 

This is my whole function, and all happens when I remove the old frames from the Items list to update the list.

function UpdateTitlesList()
	for _, tagged in pairs(titleList.Items:GetChildren()) do
		if tagged:FindFirstChild("Tagged") then
			tagged:Destroy()
		end
	end

	for _, title in pairs(titles) do
		local template = titleList.Items.Template:Clone()
		local tag = Instance.new("BoolValue", frame)
		tag.Name = "Tagged"
		tag.Parent = template

		template.Name = title.Name
		template.TitleLabel.Text = title.Name
		
		if title.Shine == true then
			for _, particle in title.Particles do
				local copyParticle = particle:Clone()
				copyParticle.Parent = template
			end
			template.TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
			template.TitleLabel.UIGradient.Color = title.ColorGradient
		else
			template.TitleLabel.TextColor3 = title.Color
		end
		
		local function DisplayOrder(tit)
			if tit.Section == "Free" then
				return 2
			elseif tit.Section == "Country" then
				return 3
			elseif tit.Section == "Special" then
				return 4
			elseif tit.Section == "Rare" then
				return 5
			elseif tit.Section == "Epic" then
				return 6
			elseif tit.Section == "Unique" then
				return 7
			elseif tit.Section == "Mythic" then
				return 8
			elseif tit.Section == "Seasonal" then
				return 0
			elseif tit.Section == "Exclusive" then
				return 1
			end
		end

		local order = DisplayOrder(title)
		template.LayoutOrder = order

		local status = titleStatus(title.Name)
		if status == "Owned" then
			template.Parent = titleList.Items
			template.Visible = true
		elseif status == "Unowned" then
			template.Visible = false
		end

		if template.Visible == true then
			template.TitleLabel.Activated:Connect(function()
				titleEquipped = title.Name
				sfx.Next:Play()
				UpdateTitleInfo(title, order)
			end)
		end
	end
end

The problem starts basically in this line:

for _, tagged in pairs(titleList.Items:GetChildren()) do
		if tagged:FindFirstChild("Tagged") then
			tagged:Destroy()
		end
	end

I’m sure this is likely because you destroyed it and it doesn’t account for it so it keeps trying to concurrently run, resulting in an error as it tries searching for the destroyed objects, no idea why you attempt to do it yourself, I’m sure the module itself has it’s own cleanup function that you can use.

image

image

I don’t understand. I do understand that removing the particles removes the image labels and it works perfectly. What I was attempting to do was removing all items from the ScrollingFrame to update it in case someone bought a title and appears a tick icon in it.

How could I remove the item without provoking that error?