Problem instantiating particle emitter

I have a part with an attachment and a particle emitter inside it. But i want to add this part to the player (and it works) when he join the scene. The problem is that the particle is not in the same position and I don’t know where is my problem, here the code if you can help me! Thanks! :smiley:

local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local Dust = RS.Fx.Dust 

local function OnPlayerAdded(player)
	local dustClone = Dust:Clone()

	local character = player.Character
	if not character then
		character = player.CharacterAdded:Wait()
	end

	local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

	dustClone.Position = humanoidRootPart.Position

	dustClone.Parent = player

	print(player.Name .. " se ha unido al juego y se le ha asignado una entidad Dust en su posición.")
end

Players.PlayerAdded:Connect(OnPlayerAdded)


Particle emitters don’t have a position property.
To change its position, parent the particle to the players HumanoidRootPart instead of the player object:

dustClone.Parent = humanoidRootPart
1 Like

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