I used FastCast Redux, It shows the trajectory but doesnt move the projectiles:
This is my code:
Code
local RaycastHitbox = require(script.RaycastHitboxV2)
local Damager = require(script.Parent.Damage)
local DEBUG = true
local FastCast = require(script.FastCastRedux)
FastCast.DebugLogging = DEBUG
FastCast.VisualizeCasts = DEBUG
local Caster = FastCast.new()
local MAXDIST = 300
local lifespan = 15
local CastParams = RaycastParams.new()
CastParams.IgnoreWater = true
CastParams.FilterType = Enum.RaycastFilterType.Blacklist
CastParams.FilterDescendantsInstances = {}
local CastBehavior = FastCast.newBehavior()
module.NewProjectile = function(Projectile, Direction, Caster_Player, Damage,Speed,weld,Acceleration)
local origin,look = unpack(Direction)
Projectile = Projectile:Clone()
Projectile.Anchored = true -- This doesnt change anything in the code when i set it to false
CastParams.FilterDescendantsInstances = {Caster_Player.Character}
CastBehavior.RaycastParams = CastParams
CastBehavior.MaxDistance = MAXDIST
local Y = look.Y
CastBehavior.Acceleration = ((look)-Vector3.new(0,Y*.023234,0))*workspace.Gravity
CastBehavior.CosmeticBulletTemplate = Projectile
--CastBehavior.CosmeticBulletProvider = CosmeticPartProvider -- Comment out if you aren't using PartCache.
CastBehavior.CosmeticBulletContainer = workspace.Projectiles
CastBehavior.AutoIgnoreContainer = true -- We already do this! We don't need the default value of true (see the bottom of this script)
local ActiveCast = Caster:Fire(origin,(look),200,CastBehavior)
Caster.RayPierced:Connect(function()
return false
end)
Caster.RayHit:Connect(function(cast, raycastResult, segmentVelocity, cosmeticBulletObject)
local hitPart = raycastResult.Instance
local hitPoint = raycastResult.Position
local normal = raycastResult.Normal
if not hitPart then return end
if hitPart.Parent == nil then return end
if hitPart.Parent.Name == Caster_Player.Name then return end
local humanoid = hitPart.Parent:FindFirstChild("Humanoid")
if not humanoid then return end
Damager.DamageModel(Caster_Player, humanoid.Parent , Damage, {ParticleAmount = 3, ParticleColor = Projectile.Color, DamageColor = Projectile.Color})
if weld then
local weld = Instance.new("Weld")
weld.Parent = Projectile
weld.Part0 = Projectile
weld.Part1 = hitPart
end
end)
wait(lifespan)
Projectile:Destroy()
return Projectile
end
return module