I am currently using FastCast module to create projectiles and I’ve encountered an issue. I have Zone Objects placed around in my Workspace and all of them are set CanCollide - Off & CanQuery - On.
Now there is a reason for having CanQuery- On, I want to handle Zone Enter Events & Zone Exit Events.
CanCollide - Off property is set to false since players are supposed to go through those Zones.
Okay, so now I have projectiles that I can Fire by using FastCast.
FilterDescendantInstances contains all Zone Objects.
Apparently, the projectile “does” work when I try to shoot from a far distance through the Zone Object, however if I get closer to the edge of the Zone, the projectile fires in different directions!
Setting the CanQuery - Off would fix this issue, but my Zone Enter Evenets & Zone Exit Events won’t work…
I’m not entirely sure how either Roblox or the FastCast module handles raycast collision, but maybe if you put the raycasts in another collision group, that would fix it? Sorry if that’s not possible with raycasts, but it’s the first thought given my limited knowledge of raycasts.
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude --> don't change with blacklist or white list because not working.
raycastParams.FilterDescendantsInstances = { -- enter your ares which you want }
for _, zone in ipairs(zonesFolder:GetChildren()) do
table.insert(raycastParams.FilterDescendantsInstances, zone)
end
I am not that familiar with fastcast but you can give it if this may work:
Is there some blacklist/whitelist you may can use within fastcast to allow certain objects to work?
Maybe using Collectionservice and tag system, you may can allow a custom tag to be allowed without effecting all other zones if this is not build in within fastcast.
Let me know how things go, I be gladly think along side with you!
This is what I was thinking of, not collision groups! Although, I think RaycastParams comes from the Roblox API, OP said he was using FastCast, so he’d have to find the equivalent in FastCast.
i used fastcast and zoneplus too. this seems correct to me.
have you tried testing without having the bullet and vfx? i doubt the bullet/vfx may have collision/query that might mess up the raycasts.
if the zones are static and not changing or moving, then you may try Zone:relocate()
it moves the zones out of workspace so fastcast cant see them
but players should still be able to enter/exit zones
just curious, if the “direction” is wrong, then it is nothing to do with fastcast/projectile in the first place, isnt it?
your filter is applied to the projectile trajectory for it to determine if it hits something or not.
BUT the initial shoot direction, how did you do it? does it use raycast ? if it does, have you applied the same filter?
This, there is likely something wring with the aiming protocols. It is probably aiming at the part of the zone object you are aiming at, not aiming behind it. You likely need to adjust the raycast parameters for translating the mouse position into a target.
NetClient_PlayAbility:Connect(function(Player, Data)
--// Define
local MousePosition = unpack(Data)
local Element = Player:GetAttribute("Element")
local Character = Player.Character
local Root = Character.HumanoidRootPart
local Origin = Root.Position
local Direction = (MousePosition - Origin).Unit