FastCastRedux returning errors constantly, need support ASAP

I am trying to make an M4 Sherman tank, and recently I’ve tried to convert the firing mechanism(s) to the FastCastRedux module to reduce lag and make the hits smoother, but I’ve come across multiple issues that I cannot overcome, even with the help of some other top devs.

I need the projectile for the main tank gun to go forward, I have yet to script the turret to turn. I cannot find any tutorial online, I’ve looked at the creator of FastCast’s posts to see, and It directed me to a website that I couldn’t understand and a demonstration model on Roblox that has so much extra stuff that it buries out what I actually need.

If anyone is willing to write out a simple and understandable script for FastCast, that DOES NOT USE Mouse.Position, and instead goes by the direction of which the part is facing, it would be greatly appreciated, I cannot figure that out.

I will attach a video of the old script I used that utilized velocity, which frequently lagged in games and caused multiple hit issues. The video will demonstrate how I want FastCast to produce the projectile.

Here is my code if you want to fix the errors yourself.

local TweenService = game:GetService("TweenService")
local Seat = script.Parent.Parent.Parts.VehicleSeat
local BarrelMain = script.Parent.Gun.BarrelMain
local BULLET_MAXDIST = math.huge
local BULLET_DROP_GRAVITY = 2
local BULLET_SPEED = 1250

local FastCast = require(script.FastCastRedux)
local Caster = FastCast.new()
Caster.Gravity = BULLET_DROP_GRAVITY
local Missile = script.Parent.Gun.Missile

local CastParams = RaycastParams.new()
CastParams.FilterType = Enum.RaycastFilterType.Blacklist
CastParams.IgnoreWater = true

local castBehavior = FastCast.new()
castBehavior.RaycastParams = CastParams
castBehavior.Acceleration = Vector3.new(0, -workspace.Gravity / 2, 0)
castBehavior.AutoIgnoreContainer = false

local CosmeticBullet = Instance.new("Part")
CosmeticBullet.Material = Enum.Material.Neon
CosmeticBullet.Color = Color3.fromRGB(255, 170, 0)
CosmeticBullet.CanCollide = false
CosmeticBullet.Anchored = true
CosmeticBullet.Size = Vector3.new(0.6, 0.6, 3)
CosmeticBullet.Shape = Enum.PartType.Cylinder

local Mesh = Instance.new("SpecialMesh", CosmeticBullet)
Mesh.MeshType = Enum.MeshType.Sphere

local function Fire()
	local Bullet = CosmeticBullet:Clone()
	Bullet.CFrame = Missile.CFrame
	Bullet.Parent = workspace
	Caster:Fire(Missile.Position, BarrelMain.BarrelMain.CFrame.UpVector, BULLET_SPEED, Bullet)
end

Caster.RayHit:Connect(function(HitPart, HitPoint, Normal, Material, CosmeticBulletObject)
	CosmeticBullet:Destroy()
	local Explosion = Instance.new("Explosion", workspace)
	Explosion.Position = HitPoint
	Explosion.BlastRadius = 10
	Explosion.BlastPressure = 200000
end)

script.Parent.Fire.OnServerEvent:Connect(function(Player)
	Caster:Fire()
end)
2 Likes
local castBehavior = FastCast.new()
castBehavior.RaycastParams = CastParams
castBehavior.Acceleration = Vector3.new(0, -workspace.Gravity / 2, 0)
castBehavior.AutoIgnoreContainer = false

Did you mean newBehavior()?