Bullet trail issues

This script to make a bullet trail from a given position to another end position works on the first shot but doesn’t show the trail when multiple instances of the bullet trail part are present in the gun. The bullet trail itself is just a part with a trail instance inside of it.

function EffectModule.BulletTrail(part, start, finish)
	local BulletTrail = ReplicatedStorage.Effects:FindFirstChild("TrailEffect"):Clone()
	BulletTrail.Parent = part
	Debris:AddItem(BulletTrail, BulletTrail:GetAttribute("LifeTime"))
	BulletTrail.Position = start
	BulletTrail.Position = finish

what is the part that its being parented to also is it being remove locally at some point or destroyed? it maybe its being removed but still declared in your variables is why there is not an error

Is that being fired every frame(just for clarification as you have the RunService.Stepped:Wait())?

the part is just where the muzzle is. I parented it there because that’s also where I put my muzzle flash. It is only removed if the tool is unequipped

no. the wait is only there so the trail apears for one frame

correction: the trail takes one frame to get to the hit position. This function is called in another function that shoots the gun at a specific firerate

Do you need to set Attachment0 and Attachment1 on the trail each time to attachments in the given part?

I don’t think so? The attachments are present before the part is cloned so it may or may not have to be reassigned

Just not sure how you make “part” that is passed in. If you clone some bullet part each time, you would want to assign the attachments from the new clone.

Nevermind, I read your post again. Maybe try using cframe instead of position when moving the trail object.

you should tween the positions just setting it to new position doesn’t move it and probably doesn’t render the trail correctly try tweening it which i would do or movers

also if you remove it to fast it may not render

I have tested this and the issue is with the wait you are using it is to fast for the render because you are just setting the position to the new one

try longer wait or try tweening the object

Not the most beautiful of solutions but I just added another line of


This fixed the problem so ¯_(ツ)_/¯