How to create a better coin splash effect?

I am aiming to create a coin effect like this which I found randomly (so I don’t know who made it).

What I got instead was this.

If this helps, I also found this as a reference that I hardly understood:
image

Attached file can be used to test as well what I tried to make:
CoinParticler.rbxm (4.7 KB)

Server script code
local coin = script.Coin
local coinSpawner = workspace.CoinSpawner

local coinSpawnerPos = coinSpawner.Position
local coinSpawnerCFrame = coinSpawner.CFrame
local coinSpawnerSizeHalf = coinSpawner.Size/2

local RunService = game:GetService("RunService")
local tweenService = game:GetService("TweenService")

local function lerp(a, b, c)
	return a + (b - a) * c
end

local function cubicBezier(t, p0, p1, p2, p3) -- p0 is origin and p3 is destination
	return (1 - t)^3*p0 + 3*(1 - t)^2*t*p1 + 3*(1 - t)*t^2*p2 + t^3*p3
end

local function travelCurve(p0, p1, p2, p3, moving)
	for t = 0, 1, 0.05 do -- 0 <= t <= 1
		local p = cubicBezier(t, p0, p1, p2, p3)
		moving.Position = p
		moving.CFrame = moving.CFrame * CFrame.Angles(math.random(1, 25), math.random(1, 25), math.random(1, 25))
		RunService.Stepped:Wait()
	end
end

local function transparencyQuad(object)
	for i = 0, 1, 0.01 do
		object.Transparency = tweenService:GetValue(i, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
		RunService.Stepped:Wait()
	end
	object:Destroy()
end

local function coinFling()
	local coinClone = coin:Clone()
	local p0 = coinSpawnerCFrame * CFrame.new(0, 0, -coinSpawnerSizeHalf.Z)
	p0 = p0.Position
	local p1 = p0 + Vector3.new(math.random(-10, 10), math.random(5, 10), math.random(-10, 10))
	local p2 = p1 + Vector3.new(0, 0, math.random(-10, 10))
	local randomNumber = math.random(1, 2)
	if randomNumber == 1 then randomNumber = -randomNumber
	else randomNumber = 1	
	end
	local randomNumber_2 = math.random(1, 2)
	if randomNumber_2 == 1 then randomNumber_2 = -randomNumber_2
	else randomNumber_2 = 1	
	end
	local p3 = coinSpawnerCFrame * CFrame.new(randomNumber*coinSpawnerSizeHalf.X, -coinSpawnerSizeHalf.Y, randomNumber*coinSpawnerSizeHalf.Z)
	p3 = Vector3.new(p2.X, p3.Y, p2.Z) + Vector3.new(0, 0, math.random(1, 5)) 
	coinClone.Parent = workspace
	coroutine.wrap(function()
		travelCurve(p0, p1, p2, p3, coinClone)
	end)()
	coroutine.wrap(function()
		transparencyQuad(coinClone)
	end)()
end

while true do
	for i = 1, 10 do
		coinFling()
		RunService.Heartbeat:Wait()
	end
	wait(2)
end
2 Likes

What’s your question that your trying to ask?

You shouldn’t have titled your post as a suggestion, but as a problem (i.e: coin splash implementation is not working properly)

I’m pretty sure that that’s a particle effect, not using parts.

Here’s I’ve created a simple recreation of it, feel free to mess around with the settings as you desire, but I gave you a little start:

CoinSplash.rbxm (3.5 KB)

Put that in workspace and it will splash coins every 0.1 seconds. Bascially, it uses the perfect combination of speed and acceleration (as well as spread angle to make a spehere) to make the coins fall down. In addition, I’ve made them fade out and decrease in size over time, just as nice little effect :slightly_smiling_face:.

Hope that helps!

3 Likes

It’s a so called 3D emitter effect so apparently it is actually an object but I’ll take a look at the file you sent, thanks for the assistance.

@Ultronlize I needed to make the coin splash effect actually better than the one I made that is way closer to the desired one I shown.

How do you want to make it better?

Well you can see how sloppy the coin effect is and that it can even fling towards only one side. As in better I mean most similar to the desired GIF I have attached.

You can add sparkles and you can set the directions, you can also edit things.

I’m 100 percent sure that they’re using parts so you can’t just do this with particle emitters.

oh, well you can still try using sparkles?

I don’t think you understand. It’s 3D objects, not particles, a sparkle is a particle. The objects are being used as particles.

It works like wanted except the asset ID you provided as an example doesn’t load or work so I need to get a new coin image for the emitter. I would still be interested in that amazing 3D emitter effect that was made by that guy but I guess it’s impossible for me so I’ll stick with the emitter you gave me. Thank you for the help.

1 Like

Welp I tried :slight_smile: heh

Way late. I came across this post because I needed to make a coin splash effect for my game, but couldn’t find anything… So I recreated the coin effect you posted.

Here is the file if you still need it: (I used 3D models and Bezier curves)
CoinSplashEffect.rbxm (17.0 KB)

Put it the folder under workspace and it will splash coins every now and then.

4 Likes

I have to say thank you for share your code, very useful in so many ways