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

Hi dev,
I have a little problem with the projectiles’s working.
In my game, I’m shooting a bullets and that reflects-off the walls and make corresponding angle and continue to move till maxDistance or maxTime.
Now what is wrong, when 1st time bullet collides with wall and gets reflected, then for the 2nd wall it sometimes clips-through that wall which is very odd. Bullet can’t ever pass through the wall even bullet’s and wall’s “CanCollide” are set to true and their “CollisionGroup” also has collision.

Here’s the reference:-
Video reference of issue

@Xan_TheDragon , can you please provide me the possible resolution in this case? Looking forward for response.

Thanks!

1 Like

No cleaner method?
If i want to unequip the weapon, throw it away, what do i do with the caster? Will it aways be there?

1 Like

I’ve been having the same question, I read the API and there’s only a “Terminate” method, but it doesn’t seem to work well for me. I think FastCast is kind of outdated at this point.

Well, using this was a massive waste of time. I don’t understand this, and for some reason it wasn’t mentioned that you need to be intermediate or so to understand how this works. All it accomplishes is making a stationary part, so… I’ll look for another gun module
image

my cosmetic bullet isnt showing up. is anyone else experiencing this issue?

Greetings,

I Am having a problem, The module is not working, It is probably because I did not know how to use it.

local Tool = script.Parent
local Remotes = Tool["Remotes."]
local Debris = game:GetService("Debris")
local FastCast = require(Tool.FastCastRedux)
local PartCahce = require(Tool.PartCache)

Remotes["Equipped."].OnServerEvent:Connect(function(Player)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	Character["Right Arm"]:FindFirstChild("RightGrip"):Destroy()
	local Joint = Instance.new("Motor6D")
	Joint.Name = "RightGrip"
	Joint.Parent = Character["Right Arm"]
	Joint.Part0 = Character["Right Arm"]
	Joint.Part1 = Tool.Handle
end)

Remotes["Unequipped."].OnServerEvent:Connect(function(Player)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	Character["Right Arm"]:FindFirstChild("RightGrip"):Destroy()
end)

local Caster = FastCast.new()

local Part = Tool["Gaurds fire particle"]
local PartProvider = PartCahce.new(Part, 100, Tool)

local RaycastParameters = RaycastParams.new()
RaycastParameters.FilterDescendantsInstances = {Tool.Parent}
RaycastParameters.FilterType = Enum.RaycastFilterType.Exclude

local CastBehavoiur = FastCast.newBehavior()
CastBehavoiur.RaycastParams = RaycastParameters
CastBehavoiur.MaxDistance = 200
CastBehavoiur.CosmeticBulletProvider = PartProvider
CastBehavoiur.CosmeticBulletContainer = Tool


Remotes["Activated."].OnServerEvent:Connect(function(Player, MousePosition: Vector3)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	local Sound = Instance.new("Sound")
	Sound.SoundId = "rbxassetid://17299679453"
	Sound.Parent = Character.PrimaryPart
	Sound:Play()
	local Direction = (MousePosition - Tool["Wand build."].Part1.Attachment1.WorldPosition)
	
	Caster:Fire(Tool["Wand build."].Part1.Attachment1.WorldPosition, Direction, 100)
end)

Is there any way to slow down bullet midair, and then make it fast again, like time dilution effect?

Yes, the logic should be inside LengthChanged event.

how exactly do I do it, I cant really understand the script in the module.

all I need is to make the bullet slow down when a value is enabled, and vice versa the trajectory stays the same

nvm i divided the delta time to simulate the slowed speed, thanks for your pointer though :smile:

1 Like

I’ve been working with FastCast to create a gun system for a project I work on and have discovered after much frustration that ActiveCast.lua’s CloneCastParams method fails to clone the RaycastParams.RespectCanCollide flag properly, causing the ActiveCast’s RaycastParams to not exhibit expected behavior. Thankfully, it’s a really easy fix. You just need to add a line to copy that parameter over.

yo anyone here know how i can rotate my cosmeticpart? i want to have throwing knifes but they always face sideways from where im pointing

nvm figured it out, now how do i convert bullets to use models instead of parts?

This module is starting to get outdated, most of my gun systems with this module broke recently

do the hitbox in the client that starts the projectile, it’ll look like that other wise.