Fastcast Help - Rid of Cosmetic bullet when ray termating

So I am using fast cast for my fps game. And I can set the max distance of the ray. But when the ray reaches the max distance unlike Caster.RayHit where I can connect a function and have the cosmetic bullet in the function parameters. I cant do this with Caster.CastTerminating. And it isn’t really pretty when they just stop mid air.

If there is anyone that is experienced with FastCast and can help is much appreciated. Or even @EtiTheSpirit them self.

Thanks.

1 Like

Why? Considering this is part of the standards for using it, mentioning a reason for why you can’t do this is super important.

3 Likes

Yeah I believe @ItxRyland is confused with the API, due to this reason, to being in the parameters:

For cast terminating it’s less obvious, we gotta access the active cast data object first like so through the following path:

		local function cleanUpBullet(activeCast)
			local bullet = activeCast.RayInfo.CosmeticBulletObject -- API wise it's pretty weird compared to OnRayHit event.
			--Debris:AddItem(bullet,1)--normal instance.new clone
			local trail = bullet:FindFirstChildWhichIsA("Trail")
			if trail then
				trail.Enabled = false
			end
			projectileCache:ReturnPart(bullet)
		end

		castComponent.CastTerminating:Connect(cleanUpBullet)

Otherwise, fastcast works great and as intended.

For the second question

Well you could always :Clone() it and disable the anchor to make it ricochet with the enviroment. Not sure what you want other than for it to dissapear. Maybe tween transparency to 1?

1 Like

i tried that myself, by printing active cast. It’s a table, I went through it in the output log and did pretty much the same thing that you did there. But it destroyed all bullets, but I will try your snippet of code there. Thanks.

1 Like

Sorry, I thought it would work like Caster.RayHit. But it doesn’t. because I bad at reading API sometimes. I just started using the Fastcast module the other day. I figured some stuff out but not all. I thought the signal would contain more info about it. I think I just misused it though.

1 Like