Does anyone know how to make particle appears when something like a ball touches a part? Help would be appriciated!
local ball = workspace.Ball
local part = workspace.Part
part.Touched:Connect(function(otherPart)
if otherPart.Name == "Ball" then
local particles = Instance.new("ParticleEmitter")
particles.Parent = part
--change the other particles properties here
end
end)
how would i change the colour? thanks btw!
> local RS = game.ReplicatedStorage
> local ball = workspace.TPS
> local part = workspace.Part
> local Part1 = game.ReplicatedStorage.Part1
> part.Touched:Connect(function(otherPart)
> if otherPart.Name == "TPS" then
>
> game.ReplicatedStorage.Part1:Clone().Parent = workspace
> local particles = Instance.new("ParticleEmitter")
> particles.Parent = game.Workspace.Part1
> wait (20)
> game.Workspace.Part1.ParticleEmitter:Destroy()
>
> end
> end)
particles.Color = Color3.new(R, G, B)
Replace R, G and B with a number between 0 and 1 inclusively.
Color3.new(1, 0, 0) is red, Color3.new(0, 1, 0) is green, Color3.new(0, 0, 1) is blue and so on.
https://developer.roblox.com/en-us/api-reference/property/ParticleEmitter/Color
it doesnt change the colour it just gives me an error in the output
Share the error that you receive please and also the modified code if you could.
My bad, you need to assign a ColorSequence value to particles.Color =
like in the following:
local white = Color3.new(1, 1, 1)
particles.Color = ColorSequence.new{
ColorSequenceKeypoint.new(0, white),
}
You can read up on ColorSequence values here:
it doesnt work
oh yeah btw how do you stop this from happening with the mouse? its really annoying
It should work, don’t use the example I provided, spend some time going through the ColorSequence page to learn how ColorSequence values work.
Also that occurs when you press the “Insert” button on your keyboard, just press it again to stop it.
I’ve changed the example I provided so that it now works, but you’ll need to make some modifications for it to fit your needs.