Hello!
I am working on a tower defense game and I am attempting to add vfx to there attacks. It works right but they are ugly so I am upgrading them. I am doing this via a script. But when I attempt to modify the size of the particle emitter, everything breaks.
local function fireProjectile(tower, target)
local projectile = Instance.new("Part")
projectile.Size = Vector3.new(1,1,1)
projectile.CFrame = tower.Head.CFrame
projectile.Anchored = true
projectile.CanCollide = false
projectile.Transparency = 1
projectile.Parent = workspace.Camera
local emitter = Instance.new("ParticleEmitter")
emitter.Texture = "rbxassetid://12390113643"
emitter.Size = 10 -- the issue is here
emitter.LightEmission = 1
emitter.LightInfluence = 0
emitter.Parent = projectile
When it tries to create the particle, it just gives me an error in the output. Saying:
It works if I use the default Roblox fire which is what I initially had it as.
local fire = Instance.new("Fire")
fire.Size = 2
fire.Heat = 0.1
fire.Color = tower.Config.Trail.Value
fire.Parent = projectile
My only idea as to why it doesn’t work is because by default particle emitters have the size set to “NumberSequence”
I’ve done some research and I can’t find out why it wont work.
Any help is appreciated!