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

how would I go about using this for a model rather than a part?

1 server script. Just use remote events and have that 1 script do the casting and damaging.

1 Like

I have a quick question. How can I change my projectiles’ colors on 1 caster instead of having individual casters have different colors because it causes lag. I have tried changing it from the projectile container and then tried taking it out, changing the color, and putting it back it but also didnt work some how. Is there a sort of way to change the custonprojectiles’ color with only 1 caster? Or is there no way?

Hey, did you ever get around latency compensation? I was just about to program this but took a look at DevForum just to make sure it wasn’t done already…

Seems like you just need some API surfaces to accelerate the simulation to any point in time.

Probably need API surfaces along the lines of:

  • ActiveCast:PredictHit(): Vector3? - Fast forward all the way to the end of trajectories so server can see what the predicted hit location is ahead of time
  • ActiveCast:GetPositionAtTime(time: number): Vector3? - Get position at t seconds after cast start time
  • ActiveCast:GetPositionAtTick(tick: number): Vector3? [Bonus] - Get position at a unix timestamp

Is there a GitHub repo where I can submit a pull request if I end up writing this into the library for my own project?

3 Likes

This module is still incredibly useful, though it’s a shame that it’s no longer being developed. I wish someone would extend it to work with parallel lua as I imagine it would improve performance a bit.

Will this work with hitscan guns or just projectile?

this is meant to be a way to simulate projectile physics, if u only need hitscan u should not use this module

I know it’s kinda long time ago, But does it work woth big projectiles?

If I want the projectile to not be laggy (I don’t want the server to handle it, yet I want every player to see it) / be accurate in terms of hit detection what should I do?

well, fastcast is intended for server sided detection and simulation and not client sided replication of the simulation but you can do your visuals on the client and do the hit detection on the server too, but this will create issues with synchronization.

You should be fine using fastcast on the server for the most part but if u need to use it on the client what I would do is get the time it took from shooter client to the server based on which get current position relative to time and speed and either start hit detection from there or instead u could multiply the time with the velocity of the projectile. You can do whatever u did from client to sever for server to other clients;

Either approach works and has its own limitations.

Hello, I want to find the latest FastCast: Redux module but I can’t find any link to get it, and the only link I can find is https://create.roblox.com/marketplace/asset/4453855787/FastCast-Redux%3Fkeyword=&pageNumber=&pagePosition= but it is not updated to the latest version

This will definitely help a new developer like me!

1 Like

How can I use part cache with this?

Hello, I was just curious if the wind functionality was ever added. That would be great!!

Hey, sorry to bump this but I’m curious.

Did you use the RayPierce functionality of FastCast which allows bullets the chance to ricochet (or pierce through surfaces. Depends on how you write your OnRayPierce function)?

And if so, how did you handle this if you’re replicating caster information to all the clients? Ricochets can be extremely unpredictable depending on how you write your OnRayPierce function and I am just lost on how I would ensure each client’s replicated bullet follows the same ricochet path.

EDIT: In hindsight, I probably should have just DMed you. My apologies if this pinged a bunch of people.

i dont know where to ask, but do i have to create a caster for each weapon or can i use one caster for multiple guns?
lets say i was using fastcast on client with a viewmodel gun, and i added weapon switching
do i have to make a new caster for each weapon in the inventory, or do i make one caster and include the weapon stats in each projectile?

EDIT: whoops, shoulda scrolled down a bit
apparently you dont need to

having a bigger hitbox for wider projectiles is now possible with blockcast and spherecast, is it possible to get an updat e?

This does not work, there are gaps in between my ConeHandles that occur pretty often. This forces me to either turn down the speed to an unplayable number or have really inconsistent raycasts. (I’m raycasting on the server)
image
Edit:
Example of such inconsistency:
image

1 Like

Hi, i would like to know how can i remove the gravity, because when i put the gravity nil, it just… get’s broken, so how can i disable the gravity?