Issues with the FastCast Module

Game Link: (Color Conquest - Roblox)


Hello. I’m making a game cald Color Conquest, where 4 teams of colors (Red, Blue, Yellow, and Green) fight for land. I’m currently making weapons for the game (Which is going to be classic Roblox weapons), and I’m making the Superball. I searched up how I can make a projectile and found a module cald FastCast, but I’m having issues with using it. Can anyone please help me?


Issues:

  • The Ball Jitter’s out sometimes
  • The Ball sometimes just puts a dot for the fast cast raycast and then unanchored itself
  • The Player and Tool has collision with the Ball
    • Probably causing the ball jittering out

Server Script:

local tool = script.Parent

local RemoteEvent = tool:WaitForChild("Activate")

local FastCastModule = require(tool:WaitForChild("FastCastRedux"))

FastCastModule.VisualizeCasts = true

local BulletFolder = Instance.new("Folder", workspace)

BulletFolder.Name = "BulletFolder"

local firePoint = tool:WaitForChild("Handle")

local projectile = tool:WaitForChild("Handle"):Clone()

projectile.Anchored = false

local caster = FastCastModule.new()

local castParams = RaycastParams.new()

castParams.FilterType = Enum.RaycastFilterType.Blacklist

castParams.IgnoreWater = true

local castBehaivor = FastCastModule.newBehavior()

castBehaivor.Acceleration = Vector3.new(0, -workspace.Gravity / 20, 0)

castBehaivor.MaxDistance = 250

castBehaivor.AutoIgnoreContainer = false

castBehaivor.CosmeticBulletContainer = BulletFolder

castBehaivor.CosmeticBulletTemplate = projectile

local function onEquipped()

castParams.FilterDescendantsInstances = {tool.Parent, BulletFolder}

end

local function fire(player, mousePos)

local origion = firePoint.Position

local direction = (mousePos - origion).Unit

caster:Fire(origion, direction, 25, castBehaivor)

end

local function onLengthChanged(cast, lastpoint, direction, length, velocity, bullet)

if bullet then

local bulletLength = bullet.Size.Z/2

local offset = CFrame.new(0, 0, -(length - bulletLength))

bullet.CFrame = CFrame.lookAt(lastpoint, lastpoint + > direction):ToWorldSpace(offset)

end

end

RemoteEvent.OnServerEvent:Connect(fire)

tool.Equipped:Connect(onEquipped)

caster.LengthChanged:Connect(onLengthChanged)

Local Script

local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local RemoteEvent = tool:WaitForChild("Activate")

tool.Activated:Connect(function()
	local mousePos = mouse.Hit.Position
	
	RemoteEvent:FireServer(mousePos)
end)