Trail created by script doesn't appear on parts

  1. What do you want to achieve?
    I am trying to make it so bullets in my game have a trail behind them whenever it is fired.
  2. What is the issue?
    The trail does not appear even though it is enabled & has the correct attachments selected.

Video of the bullet:


3. What solutions have you tried so far?
I have tried looking in the DevForum for answers and such however it has not helped at all. If anyone knows whats wrong, please tell me.

I am quite new to using trails and such so if anyone can help me I’d be ever grateful.

Code to make the bullet and trail:

local Attachment0 = Instance.new("Attachment")
Attachment0.Name = "Attachment0"
Attachment0.Visible = true
Attachment0.Parent = Player.Character.Head
Attachment0.Position = Player.Character.Head.Position
local Bullet = Instance.new("Part")
Bullet.Name = "Bullet"
Bullet.Parent = Player.Character
Bullet.Position = Player.Character.Head.Position
Bullet.CanCollide = false
Bullet.Anchored = true
Bullet.Shape = Enum.PartType.Ball
Bullet.Size = Vector3.new(0.3,0.3,0.3)
local Attachment1 = Instance.new("Attachment")
Attachment1.Name = "Attachment1"
Attachment1.Parent = Player.Character.Head
Attachment1.Visible = true
Attachment1.Position = Bullet.Position
local Trail = Instance.new("Trail")
Trail.Parent = Player.Character
Trail.LightEmission = 0
Trail.LightInfluence = 1
Trail.Enabled = true
Trail.Lifetime = 0.1
Trail.Attachment0 = Attachment0
Trail.Attachment1 = Attachment1
local Goal = {}
Goal.Position = position -- Ray Hit Position
local tweenInfo = TweenInfo.new(
	0.1, 
	Enum.EasingStyle.Linear, 
	Enum.EasingDirection.InOut, 
	0, 
	false,
	0
)
local Tween = TweenService:Create(Bullet,tweenInfo,Goal)
Tween:Play()
1 Like

Try parenting one of the attachments to the bullet

Nope, still same thing, the trail doesn’t appear.

Hmm I think I know if your bullet is moving completely straight the trail is basically invisible
you could try making a second small part that follows slightly behind the bullet so the trail becomes visible

The trail effect only requires one attachment for beginners but I think the issue may be that both of your attachments are being parented to the player’s head and is never parented to the bullet.

A user told me to do this in a previous reply, however it changed nothing and it didn’t work.

Trails are rendered between 2 attachments, so if they are parented to the head, they will move together with the head instead of the bullet. If they are parented to the bullet, then they’ll move together with the bullet. If one is parented to the head and the other to the bullet, then you’ll get a very thin trail between the 2.

Attachment0.Position = Vector3.new(0,0.2,0)
Attachment1.Position = Vector3.new(0,-0.2,0)
Attachment0.Parent = Bullet
Attachment1.Parent = Bullet