Slash VFX Isnt Syncing? Maybe A Welding issue?

Hey Im having some issues trying to get this slash vfx to sync ingame, i put this as a scripting error because I think it has something to do with the welding part but in short…

I want the slash part of this vfx to always be in the correct rotation but it randomly changes sometimes its the complete opposite, i have always had this issue with slashes and i would love to know what im doing wrong or the right way to do it, ill show my current script and how it looks in game compared to how to vfx looks out of game if you know what i mean

function VFXModule.HeavySlash(c)
	local vfxpart = ReplicatedStorage.Assets.Items.Weapons["Cutlass"].VFX.CutlassSkill:Clone()
	vfxpart.Parent = c
	local weldBall = Instance.new("Weld")
	weldBall.Name = "weldBall"
	weldBall.Part0 = c.HumanoidRootPart
	weldBall.Part1 = vfxpart
	weldBall.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
	weldBall.Parent = c.HumanoidRootPart 
	
	for i, v in pairs(vfxpart.Slash:GetChildren()) do
		if v:IsA("ParticleEmitter") then
			local emitCount = v:GetAttribute("EmitCount")
			if emitCount and typeof(emitCount) == "number" then
				v:Emit(emitCount)
			end
		end
	end
	
	for i, v in pairs(vfxpart.Extra:GetChildren()) do
		if v:IsA("ParticleEmitter") then
			local emitCount = v:GetAttribute("EmitCount")
			if emitCount and typeof(emitCount) == "number" then
				v:Emit(emitCount)
			end
		end
	end
	

end

This is what it currently looks like in game when emited


This is what it SHOULD look like in game

As you can see the in game one isnt synced its pretty random and the roblox studio one is always perfect, as i said i think its the welding/scripting im doing wrong here so would love to know any ways to fix this thank you!

I remember I encountered this issue when I first started VFX and I was using flip book particles for slashes. The main issue is that roblox has issues rendering particles in a consistent way when your playing your game and the ParticleEmitter is set on VelocityPerpendicular and emits directly upwards. This is a video of thing i was trying to fix back then:

To fix the issue, I just changed the CFrame of the ParticleEmitter’s parent to be very slightly angled. This fixed my issue and the particles emitted consistently. Since the particles are 2D, the angle isn’t really noticeable.

slash.CFrame = hrp.CFrame * CFrame.Angles(math.rad(-2), math.rad(70), math.rad(-180))

so just change the c0 x angle to something like this and see if it works

weldBall.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-1),math.rad(90),math.rad(0))

Goat. this fixed everything thank you

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.