I need help stopping fastcast bullets

So I’m using fast cast for my gun system and I want to be able to “Pause my bullets” so far I can only pause the cosmetics

caster.LengthChanged:Connect(function(cast, lastPoint, dir, length)
			local Blength = bullet.Size.Z / 2
			local offset = CFrame.new(0, 0, -(length - Blength))
			if workspace.ArenaStatus.TimeStop.Value ~= true then
				bullet.CFrame = CFrame.lookAt(lastPoint, lastPoint + dir):ToWorldSpace(offset)
			end
		end)

I don’t know where do I pause or slow down the

caster.LengthChanged

function

Cause I know that the ray is still going

This is what I have so far

local bullet = GunSetting.BulletModel:Clone()
		bullet.Parent = workspace.BulletFolder
		addBulletToFilter(bullet)

		local direction = (MousePosition - origin).Unit
		local directionCFrame = CFrame.new(Vector3.new(), direction)
		local spreaddirection = CFrame.fromOrientation(0, 0, math.random(0, math.pi * 2))
		local spreadangle = CFrame.fromOrientation(math.rad(math.random(GunSetting.MinSpread * 100, GunSetting.MaxSpread * 100) / 100), 0, 0)
		local DIR = (directionCFrame * spreaddirection * spreadangle).LookVector

		local caster = FC.new()
		local behaviour = caster.newBehavior()
		behaviour.RaycastParams = params

		caster.LengthChanged:Connect(function(cast, lastPoint, dir, length)
			local Blength = bullet.Size.Z / 2
			local offset = CFrame.new(0, 0, -(length - Blength))
			if workspace.ArenaStatus.TimeStop.Value ~= true then
				bullet.CFrame = CFrame.lookAt(lastPoint, lastPoint + dir):ToWorldSpace(offset)
			end
		end)
		
		bullet.CFrame = CFrame.new(origin)
1 Like

Bumped his post award/./././././././././././…//.//./././/./././././.

I’ve never used fastcast before but I just checked the source code and there’s a boolean Paused variable you can probbaly use

-- Represents a CastStateInfo :: https://etithespirit.github.io/FastCastAPIDocs/fastcast-objects/caststateinfo/
export type CastStateInfo = {
	UpdateConnection: RBXScriptSignal,
	HighFidelityBehavior: number,
	HighFidelitySegmentSize: number,

	Paused: boolean,

	TotalRuntime: number,
	DistanceCovered: number,
	IsActivelySimulatingPierce: boolean,
	IsActivelyResimulating: boolean,
	CancelHighResCast: boolean,
	Trajectories: {[number]: CastTrajectory}
}

documentation:


https://etithespir.it/FastCastAPIDocs/fastcast-objects/caststateinfo/#boolean-paused

1 Like

I found a solution to my problem, but thanks to your info I managed to locate the problem. I’ll accept it as solution :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.