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)