How would I make a bullet trail using the FastCast module?
I’m not on PC right now, on mobile, so I can’t give you any code. I can point you in the direction which I use. When you use fastCast, there is an option for an cosmetic bullet, when you instance the part for the cosmetic bullet, instance 2 attachment points and a trail and properly add the attachments through the position property. (I would recommend building your bullet in workspace then you can copy it in.
Thanks for the reply. I might need some further guidance we you get on PC because I think I’m going to get lost along the way…
Are you trying to do something like trails?
Yes but what way should I do it?
So here is the API page that has the CosmeticBulletTemplate, which you will want to be using.
So once you have made your cast,
it should look something like this:
local fastCast = require(--Path to module) local caster = fastCast.new()
To start, we need a bullet folder in the workspace, which we will create like this:
local bulletFolder = workspace:FindFirstChild("BulletFolder") or Instance.new("Folder", workspace) bulletFolder.Name = "BulletFolder"
Then we want to make a bullet, for example, I will be using a default part.
local bulletPart= Instance.new("Part") bulletPart.CanCollide = false bulletPart.Material = Enum.Material.Metal
Then, we want to make some attachments:
local attach0 = Instance.new("Attachment") attach0.Name = "Attachment0" attach0.Parent = bulletPart attach0.Position = Vector3.new(0, 0.055, 0) local attach1 = Instance.new("Attachment") attach1.Name = "Attachment1" attach1.Parent = bulletPart attach1.Position = Vector3.new(0, -0.055, 0)
Then we can make our trail:
local trailPart = Instance.new("Trail") trailPart.Parent = bulletPart trailPart.Attachment0 = bulletPart.Attachment0 trailPart.Attachment1 = bulletPart.Attachment1 trailPart.Lifetime = 0.1
And then finally we can tie it together with the behavior.
local castBehavior = fastCast.newBehavior() castBehavior.CosmeticBulletContainer = bulletFolder castBehavior.CosmeticlugerBullet = bulletPart
And that should be it