Particle Emitter emitting backwards while playtesting?

I have this weird problem that I’ve been stuck on for hours. I have this VFX that emits properly when you emit it in studio. But during playtesting, the emitter seems to be emitting backwards, which is not supposed to be happening. Please refer to the videos.

Here is my code:

local Debris = require(game.ReplicatedStorage.Modules.Debris)
local Assets = game.ReplicatedStorage.Assets

local function Emit(Parent)
	for _, instance : Instance in pairs(Parent:GetDescendants()) do
		if instance:IsA("ParticleEmitter") then
			task.delay(instance:GetAttribute("EmitDelay"), function()
				instance:Emit(instance:GetAttribute("EmitCount"))
			end)
		end
	end
end

local function AdjustVelocity(LinearVelocity, GeneralVelocity, Life)
	LinearVelocity.VectorVelocity = GeneralVelocity
	task.delay(Life, function()
		LinearVelocity.VectorVelocity = Vector3.new(0, 0, 0)
	end)
end

return function(Owner)
	local RootPart = Owner.HumanoidRootPart
	for _, Attachment in pairs(script.Combo:GetChildren()) do
		local New = Attachment:Clone()
		New.Parent = RootPart
		Debris:AddItem(New, 5)
		Emit(New)
	end 
	
	local Attachment = Instance.new('Attachment', RootPart)
	local LinearVelocity = Instance.new('LinearVelocity', Attachment)
	LinearVelocity.MaxForce = 999999
	LinearVelocity.VectorVelocity = Vector3.new(0, 0, 0)
	LinearVelocity.Attachment0 = Attachment
	local GeneralVelocity = RootPart.CFrame.LookVector * 46
	
	local Run = {
		{
			Time = 0.3;
			Callback = function()
				AdjustVelocity(LinearVelocity, GeneralVelocity, 0.15)
			end,
		};
		{
			Time = 0.68;
			Callback = function()
				AdjustVelocity(LinearVelocity, GeneralVelocity, 0.1)
			end,
		};
		{
			Time = 0.2;
			Callback = function()
				AdjustVelocity(LinearVelocity, GeneralVelocity, 0.1)
			end,
		};
		{
			Time = 1;
			Callback = function()
				LinearVelocity:Destroy()
			end,
		};
	}
	
	for _, ToRun in pairs(Run) do
		task.wait(ToRun.Time)
		ToRun.Callback()
	end
end

In ROBLOX studio:

While Playtesting:

1 Like

If you need more information, feel free to ask for it! (By the way, I already made sure those two are the SAME particle emitters)

ANOTHER NOTE
I removed the velocity and it seems to be working fine 90% of the time. However, when I hold down a movement key (ex. WASD), it breaks again… (The thing is, the velocity is essential… so I cannot remove it)

This is probably because of the player animations.
​​
​​​​​​​​In studio, the rig was completely non-moving, while in playtesting the animations were causing the particles to emit in the back as the sword was being swung around back there.

Not sure, but only thing I see :man_shrugging:

1 Like

After reading the code, I noticed it’s emitting from the HumanoidRootpart, mb…

but this still could be due to player movement when you’re moving forward.

1 Like

I agree that it could be due to player movement, but I am not sure how I would go about fixing this. The movement is essential to the ability itself. Can you give me an idea on how you would fix it?

I would maybe make a separate attachment for the effect and offset it a bit Infront of the player.

1 Like

image
I already use seperate attachments for the effect. Did you mean something else? Also, I tried offsetting but it didn’t work.

Are the attachments rotated at all during the attack?

1 Like

Nope, not at all. There is nothing in my script that rotates the attachments. I also checked during playtesting by using a loop that prints out attachment orientation.

Hey, so after closer review on the video.

spin

When you spin here, does it also rotate the ENTIRE character?
including the humanoidrootpart?

I’m not familiar with how animations affect the humanoidrootpart

1 Like

Nope. I checked again by making the HRP visible with a decal to show the front face.

Alright, I honestly don’t know. I don’t see any other users posting so here is a idea(s)…

  1. The attachment may be facing the wrong direction causing the particle to emit from the back.
  2. The particles are emitting wrong

As the particles are not even facing the correct way, it may be because of the emitter or attachment and not because of the animations/HRP.

1 Like

I appreciate your patience. Thank you for trying to assist me! If I don’t resolve this problem, I’ll probably resort to an alternative. (mesh-based VFX flipbooks) Once again, thank you!

1 Like

Last guess, but try messing around with GeneralVelocity see if it helps.
Anyway, I really love your VFX man, keep up the good work :smiley:

1 Like

Yeah I have the same issue, I have no rotation or cframe change, even while standing still i have a 180 degree slash that is emitting randomly. Did anyone find this solution?

What is your VelocityInheritance set to? .. if it’s over 0 try 0. Kind of a long shot I know.

Whether it’s a part, attachment or anything that has a CFrame it copies that exact value of the HumanoidRootPart and sometimes the HumanoidRootPart has negative values in x and z even if it’s -0 it can break. In my case I was using a Part that copied the HumanoidRootParts CFrame then put the attachment in the Part and emitted and sometimes it would emit backwards. To Stop this I’d make sure only the Y value changes instead of the x and z values (positive values only). For example for me I did this

local _,y,_ = HumanoidRootPart.CFrame:ToOrientation()
Part.CFrame =  CFrame.new(HumanoidRootPart.Position) * CFrame.Angles(0,y,0)