Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trail effect not working and no idea why. Pls help?

Asked by
Nep_Ryker 131
6 years ago

I have no idea why it's not working, all of it seems to be working but it's just not. Here is the script:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
    local trail = game.ServerStorage.Trail:Clone()
    trail.Parent = char.LeftUpperLeg
    local attachment0 = Instance.new("Attachment",char.LeftUpperLeg)
    print("Hi")
    attachment0.Name = "TrailAttachment0"
    local attachment1 = Instance.new("Attachment",char.LeftFoot)
    attachment1.Name = "TrailAttachment1"
    trail.Attachment0 = attachment0
    trail.Attachment1 = attachment1
    end)
end)

It seems that all of it is correct, but for some reason when I check my character when I test the game, it doesn't even seem to be making trail's parent to the LeftUpperLeg. It only works if I set it's parent to the Head. I want to make a trail that starts from your LeftUpperLeg until your LeftFoot, but it doesn't seem to be working. Pls help if u know ;-;

1 answer

Log in to vote
1
Answered by 6 years ago

Are you using a particle emitter as the trail? If so, you should make sure that when you clone it you enable it and make sure the main properties are set (rate, lifetime, speed, etc). Also I would recommend using a weld instead of an attachment just because I have had better luck using welds instead of attachments for these types of things in the past. Hope this helped! Here's a script that might work better,

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
    local trail = game.ServerStorage.Trail:Clone()
    trail.Parent = char.LeftUpperLeg
    local weld = Instance.new("Weld", trail)
    weld.Part0 = trail
    weld.Part1 = trail.Parent   
    end)
end)

I'm sorry if this doesn't work, I might not completely understand the issue. Hopefully it will though. Good luck!

0
Thank you, been busy with school lately in the past month that's why your answer didn't get accepted yet ;P Nep_Ryker 131 — 6y
Ad

Answer this question