FastCast Bullet spawns ahead of fire point

I’m making an FPS, and using FastCast for bullets.

When firing, the bullet fires ahead of the fire point. The higher the velocity is, the farther it is.

100 Velocity Shot
(Velocity is 100)

1,000 Velocity Shot
(Velocity is 1,000)

Here is the code that moves the cosmetic bullet:
Cosmetic Code
(The size is for an older bullet that I might switch back to, I swapped it with a trail)

And here’s the code that fires it.

I think the problem is that the cast starts before the the bullet is created, but I’m not sure.

The fire point is on the tip of the gun.

You aren’t placing the bullet at the fire point, you are starting the bullet at
bullet.CFrame = + (direction * length))
Try rendering it at (or just slightly past) the fire point first, then add the (lastPoint + (direction * length))

I probably know how to set the bullet’s position to the fire point, but I don’t know when, I don’t think there’s an event for when the bullet fires, and the lengthChanged function fires immediately after the bullet is made

Where in the script is the onLengthChanged function fired?
I’d think you need to make sure that the first bullet.CFrame = + (direction * length)) has the lastPoint at whatever location the fire point is, but make sure that direction * length is set at 0 for the first render.

It’s below the function that fires when the ray hits something, and above the function that fires the bullet. Here’s the entire script:

local fireEvent = script.Parent:WaitForChild("Fire")

local FastCast = require(game.ServerStorage:WaitForChild("FastCastRedux"))
local PartCache = require(game.ServerStorage.PartCache)

local origin =
local direction =

local bulletsFolder = workspace:FindFirstChild("BulletFolder") or"Folder", workspace) 
bulletsFolder.Name = "BulletFolder"

--make base bullet
local bulletTemplate ="Part")
bulletTemplate.Anchored = true
bulletTemplate.CanCollide = false
bulletTemplate.Shape = "Ball"
bulletTemplate.Size =,0.2,0.2)
bulletTemplate.Material = Enum.Material.Neon
bulletTemplate.CastShadow = false
bulletTemplate.Color =,1,0)
bulletTemplate.Transparency = 1

--make attachments for trail
local leftAttach ="Attachment", bulletTemplate)
leftAttach.Position =,0,0)
local rightAttach ="Attachment", bulletTemplate)
rightAttach.Position =,0,0)

--trail itself
local trail ="Trail", bulletTemplate)
trail.Color ={,,1,1)),,,1,1)),,,1,0.1)),,,0,0)),,,0,0))
trail.FaceCamera = true
trail.LightEmission = 1
trail.LightInfluence = 1
trail.Transparency ={, 0),, 1)
trail.Archivable = true
trail.Attachment0 = leftAttach
trail.Attachment1 = rightAttach
trail.Enabled = false
trail.Lifetime = 0.2

local caster = FastCast:new()

local rayParams =
rayParams.FilterType = Enum.RaycastFilterType.Blacklist
rayParams.FilterDescendantsInstances = {script.Parent, bulletsFolder}

local bulletCache =, 100, bulletsFolder)

local behavior = FastCast:newBehavior()
behavior.Acceleration =, -workspace.Gravity, 0)
behavior.IgnoreWater = true
behavior.AutoIgnoreContainer = false
behavior.RaycastParams = rayParams
behavior.CosmeticBulletContainer = bulletsFolder
behavior.CosmeticBulletProvider = bulletCache

local function onRayHit(cast, result, velocity, bullet)
	local hit = result.Instance
	local character = hit:FindFirstAncestorWhichIsA("Model")
	if character and character:FindFirstChild("Humanoid") then
		if hit.Name == "Head" then
		elseif hit.Name == "LeftUpperLeg" or hit.Name == "LeftLowerLeg" or hit.Name == "LeftFoot" or hit.Name == "RightUpperLeg" or hit.Name == "RightLowerLeg" or hit.Name == "RightFoot" then
	delay(2, function()
		bullet.Trail.Enabled = false

local function onLengthChanged(cast, lastPoint, direction, length, velocity, bullet)
	bullet.Trail.Enabled = true
	if bullet then
		bullet.CFrame = + (direction * length))
		--bullet.Size =,0.2,math.abs(velocity.Magnitude)/25)

fireEvent.OnServerEvent:Connect(function(player, firePoint, fireDirection, ignore)
	origin = firePoint
	direction = (fireDirection - firePoint).Unit
	rayParams.FilterDescendantsInstances = {script.Parent, game.Workspace:WaitForChild(ignore), bulletsFolder}
	behavior.RaycastParams = rayParams
	caster:Fire(origin, direction, 1000, behavior)

1 Like

did you find a solution? I’m having the same problem

You can do this frame check strat.

1 Like

To anyone still having any issues with this, you can simply add this code into the ActiveCast module on line 168, right before the module fires the LengthChanged signal.

if RunService:IsServer() then