FastCast2 - An improved version of FastCast with Parallel scripting, more extensions, and statically typed, A powerful modern projectile library

hello, whenever i try to use caster:Init with objectcache enabled i get
“Infinite yield possible on ‘ReplicatedFirst.CastVMContainer.Actor:WaitForChild(“ActiveCastObjectCache”)’”

caster2:Init(
	4, -- Roblox limits at 4 :(
	ReplicatedFirst,
	"CastVMs",
	ReplicatedFirst,
	"CastVMContainer",
	"CastVM",
	true,             -- Enable BulkMoveTo for CosmeticBulletObjects.
	nil, -- ModuleScript returning a FastCastEvents table.
	true,            -- Enable ObjectCache for this Caster.
	ReplicatedStorage.Assets.Bullet,         -- Template object for ObjectCache (if enabled).
	50,
	workspace.Assets.Bullets -- Parent Instance for cached objects (if enabled).
)

however when i went into the fastcast2 script and changed waitforchild with findfirstchild (the thing you said not to replace it with), it works, whys that

for _, v in vmDispatcher.Threads do
		print(v)

		local BindableObjectCache: BindableFunction = v:WaitForChild("ActiveCastObjectCache") :: BindableFunction
		if BindableObjectCache then
			--print("CONNECTED")
			BindableObjectCache.OnInvoke = function(targetCFrame: CFrame)
				--print("INVOKED")
				return self.ObjectCache:GetPart(targetCFrame)
			end -- OH MY GOD
		end
	end 
1 Like

If is works for you it’s okay to replacing WaitForChild with FindFirstChild.

But sometimes when you use FindFirstChild, if it not exist or nil, it will throw an error.

You can give the full code, so it gives me more context on what’s wrong.


Why should we use or trust this

2 Likes

Heya! I recommend using Vetra or Swiftcast :D.

2 Likes

I’m not a maintainer or developer of FastCast2 now.

I would def say switch to SwiftCast, which has more modern features FastCast2 doesn’t.
FastCast and FastCast2 is really old roblox projectile library rn.

You can not use or trust.

I’m okay with it.

Hey also I like your Vetra project.
Looks promising than SwiftCast and FastCast2.

Also talking about “Improve performance” I might leave whole documentation about it for anyone willing to improve FastCast2.

Thanks mawin, Feel free to give feedbacks or bug reports.