Making a combat game with ranged weapons? FastCast may be the module for you!

I was wondering if it is possible to remove an instance from the blacklist/whitelist. In my case I need the player character removed from the blacklist when the projectile is deflected.

Yes you can I do it just to create the hitbox on the server while I make the client create the cosmetics.
you just set the CosmeticBulletTemplate to nil

2 Likes

You can modify cast.RayInfo.Parameters (see CastRayInfo for more information on this).

I just checked and had few tests, they don’t seem to work, as I assume the received params are only duplication, therefore changing them won’t affect the ActiveCasts. Is that so?

I have made it work through editing it directly in the ActiveCast module. For my using case it seems fine, however, I’d like to know if it will be a gate to other unnoticed issues.

for i,v in pairs(originalFilter) do
	if typeof(v) == 'Instance' then
		if v.ClassName == 'Model' and v:FindFirstChildOfClass("Humanoid") then
				table.remove(originalFilter,i)
			end
		end
	end

Hey! I’m just curious would it be possible to create a bullet that would return to you almost like a boomerang? If so, how should I do it?

That’s what the docs say (and it’s part of why I linked them to you in the first place)

The RaycastParams used in all raycasts from this ActiveCast. This can be freely edited. When the ActiveCast is instantiated, the input parameters are cloned, and this property is set to the clone instance.

Every edit affects active casts individually.

Probably by setting the cast’s acceleration to a vector pointing back to the player. Just a word of warning though, setting acceleration (or any property really, velocity, position) every frame is not something FC is designed to handle and this will cause some pretty big lag as it has to instantiate a new CastTrajectory every time you change this value on a new frame.

Thanks for the info, but is there a way get every 5th segment? (so I can change the acceleration,)

Count it yourself. You can use ExtraData (a field of ActiveCast, once again covered on the wiki) to store a number value under a key of your choosing.

@EtiTheSpirit Is there a way to remove bounce from the bullets?

@EtiTheSpirit is there a way to use Caster.LengthChanged to make a constant spin to a projectile?

1 Like

Remove the CanPierce event.
or just have it return false.

1 Like

Is there some sort of event or connection for when the caster is fired? I would like to make each cosmetic bullet a different color, but retain that color throughout its travel.

I think implementing hit detection would be good here. This module would be so much more usable if it included hit detection. It is now more difficult then originally to script my own hit detection that follows over your fast cast.

Does this work in a local script? I can’t seem to get it to work.

Is there any way to set a minimum length for the rays? So like a cast in 60fps has the same length as one in 30fps.

1 Like

The best you can do is a target length with the manual cast resolution parameter of the behavior object (docs cover that). A min/max setup is not possible.

1 Like

You could write a function based on distance traveled to calculate a rotation.

No. Please view the docs for Caster:Fire - you can use the object it returns to achieve this goal.

Have you considered uh… using the module? (The module is a hit detection system, that’s literally what it was made for, the entire reason for its design).

FastCast is an interface - it is not dependent on sided behavior (server vs client) and will work on both sides equally.

1 Like

Hey everybody – I’ve just fixed a bug with the API docs caused by migrating to my new domain where links would not work on the docs.

This has been fixed, though there’s some slight coloring issues on the site for some links now, these will all be ironed out soon. Sorry that the site wasn’t working before! Note that this may take some time to show up.

yeah, sorry about that. Don’t mind my suggestion, i learned how to read.