I had the same issue with the intended use with fastcast. My solution was to disable the trail when the bullets are put away and reenable them when they spawn back in.
Edit: Here is how it goes which uses the fastcasthandler approach. I had to coroutine a yield to guarantee the bullet gets moved into position then the trail activates but turns out it’s not that necessary just there if it happens.
Fastcast fire function which enables the trail if it finds one
local fastcastHandler = {
fastcast = castComponent,
velocity = bulletVelocity or 1000,
ratePerMinute = ratePerMinuteFire or rpm, --second per bullet
}
function fastcastHandler:Fire(origin, direction)
local activeCast = self.fastcast:Fire(origin, direction, self.velocity, fastCastBehavior)
local bullet = activeCast.RayInfo.CosmeticBulletObject
local trail = bullet:FindFirstChildWhichIsA("Trail")
if trail then
trail.Enabled = false
--coroutine.wrap(function()
--Prevents the trail glitch from occuring
--RunService.RenderStepped:Wait()
trail.Enabled = true
--end)()
end
Clean up function disabling the trail using cast terminating like a good boy
local function cleanUpBullet(activeCast)
local bullet = activeCast.RayInfo.CosmeticBulletObject
--Debris:AddItem(bullet,1)--normal instance.new clone
local trail = bullet:FindFirstChildWhichIsA("Trail")
if trail then
trail.Enabled = false
end
projectileCache:ReturnPart(bullet)
end
castComponent.CastTerminating:Connect(cleanUpBullet)
It can be more optimized using bullet.Trail instead of FindFirstChild but I’m lazy
so thats to avoid the fact that not all my bullets have a .Trail so just be aware of that.