I’ve got a question. For some reason my bow won’t fire in the proper direction. The gray part is the position my arrow should hit, but for some reason it just shoots straight up?
I’m not really sure what I’m doing wrong here. This is basically my code:
local TargetPosition = Mouse.Hit.P --FYI this is all on the server. I'm just using this so you can easily see what TargetPosition is.
local Velocity = 1000
--
local FastCastBehavior = FastCast.newBehavior()
--Edit FastCastBehavior:
FastCastBehavior.RaycastParams = BowRaycastParams --BowRaycastParams.TargetBlackList = {Character, Bow}.
FastCastBehavior.MaxDistance = 10000
FastCastBehavior.Acceleration = Vector3.new(0,-50,0) --Simulating gravity hopefully.
Caster:Fire(Arrow.Position, TargetPosition, Velocity, FastCastBehavior)
TargetFilter seems to be working. I just made it so the gray part moves to TargetPosition on the server:
It’s like somehow TargetPosition is getting lost in translation? This is my code:
BowManagerServer.ShootBow = function(Player, TargetPosition)
game.Workspace.TestPart.CFrame = CFrame.new(TargetPosition)
local Character = Player.Character
local Bow = Character:FindFirstChild("Bow")
local Arrow = MainGame.GenericFunctions.FindFirstDescendant(Bow, "Arrow")
if Bow and Arrow then --Bow and Arrow? Get it? No pun intended :)
BowRaycastParams.FilterDescendantsInstances = BowManagerClient.GetBlackList(Character) --This returns an identical TargetFilter to the one the mouse is using.
BowRaycastParams.FilterType = Enum.RaycastFilterType.Blacklist
Caster:Fire(Arrow.Position, TargetPosition, BowSettings.Velocity, FastCastBehavior)
end
end
Oh my gosh… I finally fixed it and it was simple too.
I was just passing the mouse’s position and not the direction the mouse was pointing. Oops. I copied a line from the example code and now it works like a charm. Thank you for putting up with me
FireWithBlacklist was removed in v11 (albeit not documented properly) because RaycastParams now has the option to swap between a whitelist or blacklist. Simply alter your RaycastParams instance accordingly, and use Fire.
Having Trouble With Blacklisting Player, Already Changed From FireWithBlacklist To Just Fire.
C = Player.Character, This Is From Fire() Function In My Server Script Allowing Player To Shoot A Bullet
local CastParams = RaycastParams.new()
CastParams.IgnoreWater = true
CastParams.FilterType = Enum.RaycastFilterType.Blacklist
CastParams.FilterDescendantsInstances = {c}
for i,v in pairs() do
if v:IsA("BasePart") or v:IsA("MeshPart") then
table.insert(CastParams.FilterDescendantsInstances,v)
end
end
CastBehavior.RaycastParams = CastParams
This model is crashing when I try to insert it. I read somewhere above to disable some beta setting, but I’m not enrolled in any beta settings anyways. How do I get this INTO my game? You definitely need to update OP with precautions on how to actually insert this if this bug is still there