I made a parry effect, and the particles just don’t show up. I used print statements, and the function is running, the particles just aren’t emitting for some reason.
Code:
local Parry = {
["ParryHit"] = function(Player, Params)
local enemycharacter = Params["enemycharacter"]
local userCharacter = Params["userCharacter"]
local enemyhumrp = enemycharacter.HumanoidRootPart
local posdiff = (enemyhumrp.Position - userCharacter.HumanoidRootPart.Position)
local VFX = game.ReplicatedStorage.Fx.HitFX.Parry:Clone()
VFX.Parent = workspace.VFXFolder[enemycharacter.Name]
VFX.CFrame = CFrame.new(posdiff.X / 2, enemyhumrp.Position.Y, posdiff.Z / 2)
game.Debris:AddItem(VFX, 20)
wait(0.1)
for i, v in pairs(VFX:GetDescendants()) do
if v:IsA("ParticleEmitter") then
print("Emit")
v:Emit(100)
end
end
end,
}
return Parry
Incorrect. Try it yourself with a disabled, default particle emitter. It still works. I think the only issue here has to be transparency or positioning if it’s printing “Emit”
You’re putting the position of the vfx at the world_origin + direction instead of userRoot + direction.
Check this line and see what it’s doing: VFX.CFrame = CFrame.new(posdiff.X / 2, enemyhumrp.Position.Y, posdiff.Z / 2)
- Mixed mashed var names within this
local direction = (enemyhumrp.Position - userCharacter.HumanoidRootPart.Position)
-- this is your vfx position
Vector3.zero + Vector3.new(direction.X * 0.5, enemyHRP.Y, direction.Z * 0.5)
-- What you most likely want is
userHRP.Position + Vector3.new(direction.X * 0.5, direction.Y, direction.Z * 0.5)
-- or the real halfway point
userHRP.Position + (direction * 0.5)