Hello anyone who reads this, im having a problem where my bullet is frozen.
This code is a local script in starterplayerscripts, its supposed to replicate the bullet from server to client but the bullet is frozen as seen in this video
local Remotes = game:GetService("ReplicatedStorage"):WaitForChild("Remotes")
local VisualizeBullet = Remotes:WaitForChild("VisualizeBullet")
local Modules = game:GetService("ReplicatedStorage"):WaitForChild("Modules")
local FastCast = require(Modules:WaitForChild("FastCastRedux"))
local BulletsFolder = workspace:WaitForChild("Bullets")
local PartCache = require(Modules:WaitForChild("PartCache"))
local Bulletcache = PartCache.new(game:GetService("ReplicatedStorage"):WaitForChild("Assets"):WaitForChild("Bullet"), 100, workspace:WaitForChild("bull"))
local Caster = FastCast.new()
local CastBehaviour = Caster.newBehavior()
local CastParams = RaycastParams.new()
CastParams.FilterType = Enum.RaycastFilterType.Exclude
CastParams.IgnoreWater = true
CastBehaviour.RaycastParams = CastParams
CastBehaviour.AutoIgnoreContainer = true
CastBehaviour.CosmeticBulletProvider = Bulletcache
CastBehaviour.CosmeticBulletContainer = BulletsFolder
local function CastTerminated(Cast)
if Cast.RayInfo.CosmeticBulletObject then
--_G.BulletCache:ReturnPart(Cast.RayInfo.CosmeticBulletObject)
end
end
VisualizeBullet.OnClientEvent:Connect(function(Tool, Firepoint, Direction)
local Config = require(Tool:FindFirstChild("Config"))
CastBehaviour.MaxDistance = Config.MaxDistance
CastBehaviour.Acceleration = Config.Gravity
CastParams.FilterDescendantsInstances = {game.Players.LocalPlayer.Character, BulletsFolder, workspace.CurrentCamera:GetChildren()}
Caster:Fire(Firepoint, Direction, 300, CastBehaviour)
end)
I don’t know what the problem is because the raycastparameters are correct, maybe its something else? (The viewmodel is in camera, which is why i did workspace.camera:getchildren() in the ray blacklist)